The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM Guess Game :)
#1
Happy American Thanksgiving everyone!!! Here's a QM Guessing game I whipped up for the holidays!!

Function QM_Guessing_Game
Code:
Copy      Help
;NewNumber
str s.RandomString(1 2 "0-9")


int i=val(s)

,
int guesses=0
str message="Make an Attempt, guess a number 1-100"
;Guess
str guess
if(!inp(guess message "QM Guess Game" "" int'test)) ret


int iguess=val(guess)
if iguess=i
,message.format("Yes, the number was %i. You are a winner![]Would you like to play again?" i)
,if(mes(message "QM Guessing Game" "YN?") = 'Y') mac "QM_Guessing_Game"
,ret
else
,guesses+1
,if guesses=8
,,message.format("You lose! The number was %i[]Would you like to play again?" i)
,,if(mes(message "QM Guessing Game" "YN?") = 'Y') mac "QM_Guessing_Game"
,,ret
,if iguess<i
,,message="Too Small, guess again"
,if iguess>i
,,message="Too Big, guess again"
,if guesses=7
,,message.from(message ", LAST CHANCE!!")
,goto Guess

Funny how much this shows how to do things with QM!!
I am thankful for Gintaras! Thank you!
jimmy vig


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)