RosettaCodeData/Task/Loops-Nested/Commodore-BASIC/loops-nested.basic

12 lines
339 B
Plaintext

10 dim a$(20,20):print "initializing...":print
20 for r=1 to 20:for c=1 to 20
30 a$(r,c)=chr$(int(rnd(1)*20)+1)
40 next c,r
50 rem now search array
60 for r=1 to 20:for c=1 to 20
70 e=asc(a$(r,c))
80 print "(";r;","c;") =";e
90 if e=20 then print "found 20. stopping search.":end
100 next c,r
110 print "search complete. no 20 found.":end