RosettaCodeData/Task/Dutch-national-flag-problem/BaCon/dutch-national-flag-problem.bacon
2017-09-25 22:28:19 +02:00

9 lines
220 B
Text

DECLARE color$[] = { "red", "white", "blue" }
DOTIMES 16
ball$ = APPEND$(ball$, 0, color$[RANDOM(3)] )
DONE
PRINT "Unsorted: ", ball$
PRINT " Sorted: ", REPLACE$(SORT$(REPLACE$(ball$, "blue", "z")), "z", "blue")