Live data from Hacker News

Nice try, kid ...

flickr.com

11–20 of 35 posts

Re: Nice try, kid ...

#11
post #9
post #3

Earlier quoted context omitted.

(for i 1 500 (prn "I will not throw paper airplanes in class.")) Although, I assume the kid forgot the \n in his printf.

"prn"? Ick. Looks like 'porn'! Why not print, or put, or puts or out or just "p"?

pr = print

prn = print followed by newline

Re: Nice try, kid ...

#12
post #3
post #2

Should have wrote it in Python to save a few lines :) for x in range(500): print 'I will not throw paper airplanes in class.' Or perhaps Arc!

(for i 1 500 (prn "I will not throw paper airplanes in class.")) Although, I assume the kid forgot the \n in his printf.

Wouldn't it be easier to type:

(repeat 500 (prn ...))

?

Re: Nice try, kid ...

#13
post #8
post #5

Earlier quoted context omitted.

Why not use Erlang and make it concurrent? :) [spawn(fun() -> print("'I will not throw paper airplanes in class.'") end) || N <- lists:seq(1, 500)]

Um. Because writing to stdout will serialize the processes?

stdout can be redirected, as to a stream that round robins it to a matrix of printers.

Re: Nice try, kid ...

#14
post #3

Earlier quoted context omitted.

(for i 1 500 (prn "I will not throw paper airplanes in class.")) Although, I assume the kid forgot the \n in his printf.

Wouldn't it be easier to type: (repeat 500 (prn ...)) ?

You are correct. I need to go back and reread the tutorial.

Re: Nice try, kid ...

#15
post #7

I actually did something similar when I was in middle school. The teacher wanted everyone in the class to write something like that 500 times and turn it in the next day. I went home and ran the following program on my Apple IIe: 10 FOR X = 1 TO 500 20 ?"I will behave myself in class" 30 NEXT X PR# 2 RUN With the printer plugged into slot 2 on the machine, this sent the output of the program to the printer. Needless…

In retrospect I wonder why we did what the teachers told us. Mostly.

Re: Nice try, kid ...

#18
post #2

Should have wrote it in Python to save a few lines :) for x in range(500): print 'I will not throw paper airplanes in class.' Or perhaps Arc!

or ruby

  (0..500).each {|i| print "I will not throw paper airplanes in class\n"}
Post reply on HN