Here's a challenge I find more interesting than the fizzbuzz seen so often: Greetings to the User
You are to write a program that does the following:
Print "What is your name? "
Read input from the user.
Print "Greetings, %s." where %s is the aforementioned input.
Try to make it as small as possible for more fun. Let's see who can write the shortest solutions in the different languages.
Forth (65 chars):
." What is your name? "pad dup 9 accept ." Greetings, "type ." ."
Common Lisp (65 chars):
(princ"What is your name? ")(format t"Greetings, ~a."(read-line))
Emacs Lisp (58 chars):
(format"Greetings, %s."(read-buffer"What is your name? "))
Post too long. Click here to view the full text.