gaslouk
New Member
Hi from beautiful Greece.
Posts: 11
|
Post by gaslouk on Feb 29, 2024 11:49:07 GMT
Hi from beautiful Greece.
from my friend Marco and me.
'*** Have the other player guess the number *** global number, adviceNumber, turn
[start] time = 10 turn = 1 input "Enter a number between 1 and 25: "; number 'there is not only a fellow player but also a referee (computer) do do adviceNumber = int(rnd(1) * 25 + 1) print "Turn: "; turn; ". My number is: "; adviceNumber; "." input "Am I correct? "; antwgeraden$ 'Referee reports if upper$(antwgeraden$) = "YES" and adviceNumber < number or adviceNumber > number then end if if upper$(antwgeraden$) <> "YES" and adviceNumber = number then antwgeraden$ = "" end if loop while upper$(antwgeraden$) = "YES" and adviceNumber <> number if adviceNumber < number or adviceNumber > number then turn = turn + 1 end if call apot loop while turn < time and adviceNumber <> number
[exit] flags = _MB_ICONQUESTION OR _MB_YESNO
calldll #user32, "MessageBoxA", _ 0 as long, _ "Are you sure you want to end the game?" as ptr, _ "Exit" as ptr, _ flags as long, _ Result as long
'Result returns : 1=ok 2=cancel 3=abort 4=retry 5=ignore 6=yes 7=no if Result = 6 then END end if if Result = 7 then goto [start] end if
sub apot if adviceNumber = number then print "Ask! I guessed it "; turn; " rounds." else print "Too bad, I didn't guess." end if end sub
Regards
Gaslouk
|
|