List made by pp., posted by LaRoza
- ABAP
- actsl
- ADA
- Ant
- Applescript
- ASM
- Assembly
- Assembly (Intel x86)
- Assembly (MIPS)
- Assembly (Motorola 68HC11)
- AutoIT
- AWK
- BASH
- BASH
- BASH
- BASH
- BASH
- BASH
- Basic
- Basic, Gambas
- Batch (MSDOS)
- Befunge
- Befunge
- binary
- BIT
- Blitz Basic
- Boo
- Brain****
- C
- C
- C
- C#
- C++
- C++
- C++
- C++
- C++ (with Gtkmm)
- C-Shell
- Clips
- COBOL
- COBOL
- Curses
- D
- D
- dBase
- Delphi
- FLEX
- Forth
- Fortran 77
- Fortran 90
- FreeBasic
- FreeBasic
- Gambas
- Go
- Go
- Groovy
- Groovy
- GTK+
- Haskell
- Haskell
- Haskell
- HEX
- High Level Assembly
- HQ9+
- Icon
- Igor Pro
- INTERCAL
- Jass
- Java
- Java
- Java
- Java
- Java
- Javascript
- Javascript
- Javascript (with Seed)
- Johan
- Jquery
- JustBasic
- LabView
- LaTex
- Lisp, Common
- Lisp, Common
- Lisp, Common
- Lisp, Emacs
- LOLCode
- LOLCode
- LOLCode
- LSL
- Lua
- Lua
- Matlab
- Matlab
- Matlab
- MirthKit/Squirrel
- MSIL/Cil
- MUMPS
- NASM ?
- NASM i386
- NASM i386
- NedCode
- Objective C
- Ocaml
- ODT
- Ook
- OPL
- Pascal
- Pascal
- Perl
- PHP
- PHP-GTK
- PHP, CGI
- PHP, CGI
- PickBasic
- PIET
- Pike
- PL/1
- PL/SQL
- PLUA
- Prolog
- PyGTK
- PyGTK, Glade
- Python
- Python
- Python
- Python
- Python
- Python/Python 3
- Python CGI
- Qbasic
- Qbasic
- Qbasic
- Qt4
- QtRuby
- Regexp
- REXX
- RPGLE
- Ruby
- Ruby
- Ruby
- Ruby/GTK2
- Scala
- Scheme
- Scheme
- SIGI
- SNOBOL
- SPIN
- Sporkl
- Spreadsheet
- SQL
- SQL
- TCL
- TI-Basic
- TI-Basic
- Turing
- TurtleScript
- V
- Vala
- VB6
- VB.NET
- VB.NET (console)
- VBA
- VBScript
- VIM
- vJass
- Whitespace
- Whitespace
- Whitespace
- Wibrel
- Windows Shell Script
- Wish
- Wrapl
- X86-64 ASM
- Xt
- XHTML/PHP
- YASM
- Zinc
- ZX Spectrum
================================================== ================================================== ===
I've just been inspired by a webpage with 193 examples of "Hello World!" programs.
I want to make something a just slightly more useful for the beginning programmer.
Write the most concise, but clearly readable program (call it helloubuntu) according to this specification:You can also use a simple GUI, like a dialog box, to ask the question, input name, etc. Just make sure the code is elegant and easy-to-understand.
- Say: "Hi! What's your name? "
- User enters name.
- Say: "Hello, (username)! Welcome to Ubuntu!"
You can use programming languages, markup languages, shell scripts, or even SQL statements.
Try not to hog too many languages. Give other posters a fair go at posting their example too. If you are posting an alternative version of code for a language that has already been posted, mention that it is an alternative version.
I'll start off:
Ada (using normal fixed-length string)
Ada (using the 2005 standard's unbounded-string)Code:with Ada.Text_IO; use Ada.Text_IO; procedure helloubuntu is username : String(1..30); lastchar : Integer; begin Put_Line("Hi! What's your name?"); Get_Line(username, lastchar); Put_Line("Hello, " & username(1..lastchar) & "! Welcome to Ubuntu!"); end helloubuntu;
Can we beat 193?Code:with Ada.Text_IO, Ada.Text_IO.Unbounded_IO, Ada.Strings.Unbounded; use Ada.Text_IO, Ada.Text_IO.Unbounded_IO, Ada.Strings.Unbounded; procedure helloubuntu is username : Unbounded_String; begin Put("Hi! What's your name? "); Get_Line(username); Put_Line("Hello, " & username & "! Welcome to Ubuntu!"); end helloubuntu;
Bookmarks