Anonymous user
Bulls and cows: Difference between revisions
→{{header|Elena}}
Line 897:
#var aRandomNumbers := randomControl randomize:9 &array:(1,2,3,4,5,6,7,8,9).
theNumbers := arrayControl
]
Line 904:
#var aRow := consoleEx write:"Your Guess ?" readLine.
^
]
Line 912:
#var aBulls := Integer new:0.
(aGuess
? [ aBulls << -1. ]
! [
control from:0 &to:3 &do:
[
#var ch := aGuess@i.
#var aNumber :=
// check range
Line 925:
// check duplicates
#var duplicate := arrayControl seek:aGuess
nil != duplicate ?
[
|