
-----------------------------------
bc123
Mon Oct 19, 2009 1:42 pm

loops?
-----------------------------------
ok i got a new project from my teach where i have to make a guessing game for example
choose a number between 1 and 10
you have 2 guesses

how would i make this??
my teacher said i needed for loops?? help XD :mrgreen:

and also where i enter a number and i give the computer an amount of guesses to guess and then he gueeses the number i entered... Both ways NEEDED!  :D

-----------------------------------
Kharybdis
Mon Oct 19, 2009 2:10 pm

Re: loops?
-----------------------------------
well.. for them to choose the number, the normal code would be something like this :


var number : int

loop
put "Choose a number between 1 and 10"
get number
exit when number >= 1 and number = 1 and number 