

Ask HN: Who enjoyed the 10 Print book? - thorin

I&#x27;m really enjoying the 10 PRINT book from a previous post.<p>http:&#x2F;&#x2F;10print.org&#x2F;<p>I thought about implementing it in the languages I use currently and it&#x27;s much more verbose. I mainly use Python, Java and PL&#x2F;SQL. I&#x27;m sure some people here can do better!<p>Python:
import random,sys
while 1 : sys.stdout.write( &quot;&#x2F;&quot; if int(random.random()+0.5) else &quot;\\&quot;)<p>PL&#x2F;SQL - not really one line but possible - first time I&#x27;ve used PUT rather than PUT_LINE:
declare i number; begin for i in 1..10000 loop if round(dbms_random.value)=0 then dbms_output.put(&#x27;&#x2F;&#x27;); else dbms_output.put(&#x27;\&#x27;); end if; end loop; dbms_output.new_line; end;<p>Haven&#x27;t done java yet!
Lets see some variations in the languages you usually use.
======
thorin
PS shame it is so hard to poke to memory these days without using C/assembly.

