Skip to content

Commit 2ffa69a

Browse files
committed
Make starting pipe types deterministic.
Starting colours are assigned deterministically (and in order) to each pipe. Starting types were assigned randomly, though. Now they are assigned the same as colours.
1 parent 36a9444 commit 2ffa69a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pipes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ for (( i=1; i<=p; i++ )); do
102102
c[i]=$((i%8)) n[i]=0 l[i]=0
103103
((x[i]=RNDSTART==1?RANDOM*w/32768:w/2))
104104
((y[i]=RNDSTART==1?RANDOM*h/32768:h/2))
105-
v[i]=${V[${#V[@]} * RANDOM / M]}
105+
v[i]=${V[$((i%${#V[@]}))]}
106106
done
107107

108108
stty -echo

0 commit comments

Comments
 (0)