RosettaCodeData/Task/Dutch-national-flag-problem/Run-BASIC/dutch-national-flag-problem.run
Ingy döt Net 776bba907c Sync
2013-10-27 22:24:23 +00:00

18 lines
315 B
Text

flag$ = "Red,White,Blue"
print "Random: |";
for i = 1 to 10
color = rnd(0) * 3 + 1
balls$(i) = word$(flag$,color,",")
print balls$(i);" |";
next i
print :print "Sorted: |";
for i = 1 to 3
color$ = word$(flag$,i,",")
for j = 1 to 10
if balls$(j) = color$ then
print balls$(j);" |";
end if
next j
next i