Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

lisphhh

Name: Anonymous 2010-03-05 12:46

So how do you write a command line program that asks the user for his name and then says "Hello %name%!" in Lisp?

Name: Anonymous 2010-03-05 12:55

Program lisphhh;
Begin
  WriteLn('the user for his name?');
  WriteLn('"Hello %name%!" in Lisp');
End.


Since you didn't ask for a specific language I took the freedom to choose PASCAL.

Name: Anonymous 2010-03-05 13:06

>>2
You mena WriteLn('"Hello %name%!" in Lisp?');

Name: Anonymous 2010-03-05 13:13

(format t "Hello ~A!" (read-line))

Name: Anonymous 2010-03-05 14:29

(format t "Hello, please enter your name:" )

Name: Anonymous 2010-03-06 20:34

#include <stdio.h>

int main (void)
{
    char name[100];
    int x, endl;
   
    printf ("Enter you're name: ");
    for (x = 0; (scanf ("%c", &name[x])), name[x] != '\n'; x++);
    endl = x;
   
    printf ("Hey there ");
   
    for (x = 0; x < endl; x++)
        printf ("%c", name[x]);
   
    printf (", you silly goose!");
   
    return 0;
}

Name: Anonymous 2010-03-06 20:37

>>6
AM I NAME?

Name: Anonymous 2010-03-06 20:46

>>6
You forgot to include the part where it checks the OS and inputs "your on macfail" or "lol winshit" depending on the result.

Name: Anonymous 2010-03-06 20:56

(defun coi ()
  (format t "ma cmene do ")
  (let ((name (read-line)))
    (format t "coi la'o gy. %name% gy.")
    name))


Additional feature: returns name.

Name: Anonymous 2010-03-06 23:20

>>6 fixed

[code]#include <stdio.h>

int main (void)
{
    char name[100];
    int x, endl;
   
    printf ("Hey there, sailor, what's your name? ");
    for (x = 0; (scanf ("%c", &name[x])), name[x] != '\n'; x++);
    endl = x;
   
    printf ("There's no easy way to say this, ");
   
    for (x = 0; x < endl; x++)
        printf ("%c", name[x]);
   
    printf (", but the test results came back.\nYou're HIV positive.");
   
    return 0;
}

Name: Anonymous 2010-03-06 23:30

>>10

BBCODE failure

#include <stdio.h>

int main (void)
{
    char name[100];
    int x, endl;
   
    printf ("Hey there, sailor, what's your name? ");
    for (x = 0; (scanf ("%c", &name[x])), name[x] != '\n'; x++);
    endl = x;
   
    printf ("There's no easy way to say this, ");
   
    for (x = 0; x < endl; x++)
        printf ("%c", name[x]);
   
    printf (", but the test results came back.\nYou're HIV positive.");
   
    /* Maybe you should stop all of that anus haxxing *
     * you goddamned homosexual                       */
   
    return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List