Dutch national flag problem: Difference between revisions

Dutch national flag problem in BASIC256
m (→‎{{header|Picat}}: Added {{out}})
(Dutch national flag problem in BASIC256)
Line 657:
Sorted: red red red red red white white white white white white blue blue blue blue blue
</pre>
 
=={{header|BASIC256}}==
<lang BASIC256>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</lang>
 
=={{header|BBC BASIC}}==
2,155

edits