| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Guessing Game GameMaker

Page history last edited by PBworks 16 years, 11 months ago

Guessing Game - GameMaker, Tony Forster

 

Mainly done with graphical drag&drop programming but had to use a little text based programming, here is the pseudocode:

 

Create Event:

set variable tries to 0

set variable thenumber to round(random(100))

repeat next action (block) 100 times

      set variable tries relative to 1

      set variable guess to get_integer("your guess?","")

      if expression guess=thenumber is true

            display message: "Correct in " +string(tries) +" tries"

            end the game

      if expression guess<thenumber is true

            display message: too low

      else

            display message: too high

display message: Can't get it after 100 tries!

end the game

 

heres the drag&drop

 

Comments (0)

You don't have permission to comment on this page.