Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
dear; (char)lotte-- (ioccc.org)
59 points by mqt on Nov 25, 2008 | hide | past | favorite | 7 comments


http://www0.us.ioccc.org/1990/westley.hint:

    Some ANSI compilers will not accept '1s' as a short integer - for
    these compilers replace the '1s' with '1'.


Hm, I'm getting this:

    sistertrain-lm :~
    [22:15:45 isaacs] $ gcc westley.c 
    westley.c:31:7: error: invalid suffix "s" on integer constant
    westley.c:93:17: error: invalid suffix "s" on integer constant
    westley.c:99:8: error: invalid suffix "s" on integer constant
    westley.c: In function 'main':
    westley.c:107: warning: incompatible implicit declaration of built-in function 'exit'
After replacing the 1s with 1, I'm seeing this instead:

    sistertrain-lm :~
    [22:17:12 isaacs] $ gcc -o westley westley.c 
    westley.c: In function 'main':
    westley.c:107: warning: incompatible implicit declaration of built-in function 'exit'

    sistertrain-lm :~
    [22:17:16 isaacs] $ ./westley 
    Bus error
Edit Oohh, you have to do ./westley <number>. That's clever. :)


Sample output:

  $ ./westley 5
  ./westley
  loves me
  ./westley
  loves me, not
  ./westley
  loves me
  ./westley
  loves me, not
  ./westley
  loves me


Damn, yo.


  > westley.c:107: warning: incompatible implicit declaration of built-in function 'exit'
You need

  #include <stdlib.h>
to declare exit().


Fun is ./westley 0


"warning: eroticism unused in function main".

beautiful :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: