| 
  • 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
 

Rockerfer_Basic_M_Leishman

Page history last edited by Mike Leishman 16 years, 10 months ago

Rockerfer Basic - and online basic interpreter

 

RockerFer Basic home page

 

 

declare variable integer secret

declare variable integer guess

declare variable integer count

declare variable string congratulations

declare variable string guess_string

declare variable string playagain

randomize

repeat

  secret = int(rnd() * 100)

  print "A number guessing game. <1-10 HOT> <11-20 WARM> otherwise COLD')"

  count = 0

  repeat

    print "Guess the secret number <1-100>"

    read guess

    count = count + 1

    if guess <> secret, then

      if abs(guess-secret) > 20, then

        print "cold"

      end if

      if abs(guess-secret) < 20 and abs(guess-secret) > 10, then

        print "warm"

      end if

      if abs(guess-secret) < 11, then

        print "hot"

      end if

    end if

  until guess = secret

  if count = 1, then

    guess_string = " guess"

  end if

  if count > 1, then

    guess_string = " guesses"

  end if

  congratulations = "you got it in " + str(count) + guess_string

  print congratulations

 

  print "Play again Y-yes N-no"

  read playagain

  playagain = left(playagain,1)

until playagain = "N" or playagain = "n"

end

Comments (0)

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