|
Re: Order for school: write little program for guessing a number
|
Posted: Feb 21, 2003 8:31 AM
|
|
code this: if you have problem, go back here
set mystery equal to call random(0,9999) set right equal to true set counter equal to 1 for (counter equal to 1; counter less than or equal 10; increment counter by 1) begin print "Enter guess : " read guess
if (guess equal to msystery) set right equal to true else if (guess is less than mystery) print "too low." else print "too high."
if (right equal to true) set counter equal to 10 increment tries by 1 end if (right equal to true) print"you guess it, it takes " + tries + " try." else print"sorry, mystery is " + mystery
|
|