Guess the number/With feedback (player): Difference between revisions

m
→‎{{header|Sidef}}: minor code fix
m (→‎{{header|Sidef}}: minor code fix)
Line 2,489:
++tries;
given (var score = STDIN.readline) {
whencase (max <= min) {
say "\nI give up...";
break;
}
when (score ~~ /^h/i) {
min = guess+1;
}
when (score ~~ /^l/i) {
max = guess;
}
when (score ~~ /^e/i) {
say "\nI knew it! It took me only #{tries} tries.";
break;
2,747

edits