RosettaCodeData/Task/Dutch-national-flag-problem/BASIC256/dutch-national-flag-problem.basic
2023-07-01 13:44:08 -04:00

19 lines
335 B
Text

arraybase 1
dim flag = {"Red","White","Blue"}
dim balls(9)
print "Random: |";
for i = 1 to 9
kolor = (rand * 3) + 1
balls[i] = flag[kolor]
print balls[i]; " |";
next i
print
print "Sorted: |";
for i = 1 to 3
kolor = flag[i]
for j = 1 to 9
if balls[j] = kolor then print balls[j]; " |";
next j
next i