Hey I'm trying to make a small program in scratch that basically does the following:
REPEAT
Prompt for how many numbers, or -1 to quit
Read HowMany
If (HowMany <> -1)
Set Max to 0
While ((HowMany > 0)
Prompt for candidate number
Read Num
If (Num > Max)
Set Max to Num
Set HowMany to HowMany – 1
Display Answer Message
Display Max
UNTIL (HowMany = -1)
Display thank you message
But with what I have now it wont quit when -1 is pressed, and I cant seem to find a way to print the answer message?
I have the program on my account as what I have so far.
Offline
Well, I'm not seeing it on your account. Maybe the server upgrade is interfering with the upload?
To display the answer, use the Say block to print it to the screen in a speech bubble. The Say block is only available for sprites (not available on the Stage) so hopefully you are doing your scripting on a sprite.
I'm not sure what's going on with the -1 exit condition....I think I'll wait until I can see the project before I hazard a guess.
Offline
Hey, yeah sorry it was affecting it its up now.. I slightly changed it. But yeah I have the basic thing down I'd just love some help fixing those two minor issues. Thanks a lot :]
Offline
Hey thanks that helped a lot, I posted what I have now, almost have it perfect, but how do I get it to say "The largest number entered was:" and "Thank you for using the program" once they quit?
Offline
ok, at the end of the
repeat until <how many=0> (or just before the second, else
stop all)
add a
say [(join|The largest number entered was: |(max))]
and then add
say[Thanks you for using the program]
underneath the first say
Offline