Mode:
Duration:
1
2
3
4
5
6
7
val steps = 10;
val _ = ref 0;
val pos = ref 0;
for i = 1 to steps do (
if Random.rand() < 0.5 then pos := !pos + 1 else pos := !pos - 1;
print(Int.toString(!pos) ^ "\n");
);Coding works best on desktop or with an external keyboard.