Hacker News new | past | comments | ask | show | jobs | submit login

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!




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?


What makes you think it's written to stdout?


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


Matrix printers?


of


I'm pretty sure the people in the Matrix will be confused when every printer in the world starts printing out "I will not throw paper airplanes in class." ... Of course, then the agents will reset the system and everyone will just experience deja vu.


Sure, of. But a Matrix of Matrix printers would be nice.


(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


Because i and t are such a waste of time! :-)


?"For the win."


Wouldn't it be easier to type:

(repeat 500 (prn ...))

?


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


or ruby

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


500.times {print "I will not throw paper airplanes in class \n"}


500.times {puts "I will not throw paper airplanes in class"}


I figured there was something in ruby for that :P




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: