Guess the number/With feedback: Difference between revisions
→{{header|Tiny Craft Basic}}
mNo edit summary |
Basicgames (talk | contribs) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 812:
printf( "Guess the number between %d and %d: ", lower_limit, upper_limit );
fflush(stdout); // Flush the output buffer
while( scanf( "%d", &guess ) == 1 ){
Line 1,432 ⟶ 1,433:
=={{header|EasyLang}}==
<syntaxhighlight
print "Guess a number between 1 and 100!"
n =
repeat
g = number input
Line 2,028 ⟶ 2,029:
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
Short n // We'll just do 1..10 to get the idea
void local fn
Short i
window 1, @"Guess the number"
for i = 1 to 10
button i,,, fn StringWithFormat(@"%d", i), ( 26 * i, 60, 40, 22 )
ButtonSetBordered( i, No )
next
button 11,,, @"Quit", ( 38, 10, 95, 32 )
button 12,,, @"Again", ( 200, 10, 95, 32 )
textlabel 13, @"Guess the number:", ( 112, 85, 200, 22 )
textlabel 14,, ( 158, 30, 100, 22 ) // Hints here
filemenu 1 : menu 1, -1, No // Build but disable File menu
editmenu 2 : menu 2, -1, No // Build but disable Edit menu
Line 2,046 ⟶ 2,047:
void local fn newGame
CFRange r = fn RangeMake( 1, 10 )
ControlRangeSetEnabled( r, Yes ) // Enable number buttobns
button 11, No // Disable Quit button
button 12, No // Disable Again button
n = rnd( 10 ) // Choose a random number
textlabel 14, @"🔴" // Not found yet
end fn
void local fn
CFRange r = fn RangeMake( 1, 10 )
select evt
case _btnClick
button tag, No
select tag
case
case 12
case n
ControlRangeSetEnabled( r,
case <
case > n :
end select
case _windowWillClose : end
Line 2,078 ⟶ 2,074:
end fn
on dialog fn doDialog▼
fn buildInterface
fn newGame
handleevents▼
▲handleevents
</syntaxhighlight>
Line 4,672 ⟶ 4,664:
Well done! You guessed it.
</pre>
=={{header|TUSCRIPT}}==
|