programgames/guess/guess.xtl
ᵘp̲lay : Num a => Int -> Int -> a
The halving player on this secret: guess the middle of what is still possible, narrow, repeat. Each guess is printed with its answer, and the result is how many guesses it took.
ᵘp̲lay ← { t b → k ← f̲irst r̲avel ᵍg̲uess b r ← t ᵍm̲ove k shown ← p̲rint! @ f̲ormat< "{k} {g:r_eply r}" r = 0 ? 1◆ 1 + t ᵘp̲lay b ᵍn̲arrow r }
Used in: ᵘp̲lay, games/guess/guess.xtl:20
ᵘr̲ound : Int -> Int
ᵘr̲ound ← { st → b ← 2 t̲ake st r ← s ᵍm̲ove ᵍg̲uess b (b ᵍn̲arrow r) c̲at (3 s̲elect st) + r ≠ 0 }
Used in: st
st0 : Int
st0 ← (3 c̲at ᵍtop) r̲eshape (ᵍtop r̲eshape 1) c̲at (ᵍtop r̲eshape ᵍtop) c̲at ᵍtop r̲eshape 0
Used in: st