Discuss Scratch

DreamsXStarz
New Scratcher
8 posts

Scratch Count

How do you make your scratch ask for an integer between 1-20 (inclusive) and make it check that it is an integer in range. Indicate if there is one or more errors and then have the sprite count from 1 till 20 starting from any number between
DreamsXStarz
New Scratcher
8 posts

Scratch Count

1-20. Please and Thanks!
DreamsXStarz
New Scratcher
8 posts

Scratch Count

RainbowCrownGames
Scratcher
38 posts

Scratch Count

Try these two The picture is HERE
DreamsXStarz
New Scratcher
8 posts

Scratch Count

Thank you )))))))))))))))))))
Specter22
Scratcher
100+ posts

Scratch Count

RainbowCrownGames wrote:

Try these two The picture is HERE

You only need one of those blocks, just have when green flag clicked broadcast message one. Also it should be if answer is greater than 0 AND less than 21, not 20.
DreamsXStarz
New Scratcher
8 posts

Scratch Count

It wasn't right. Can you tell me in a different way?
REPUS
Scratcher
18 posts

Scratch Count

when [ Space] key pressed
ask [Pick a number, 1-20] and wait
if <<(answer) > [0]> and <<(answer) < [21 ]>> then
say [It is 1-20]
end
Sorry, the color of the blocks isn't right.

Last edited by REPUS (Oct. 30, 2014 02:08:58)

jburnham20
Scratcher
6 posts

Scratch Count

when green flag clicked
forever

define (Awesomeness)
end
DreamsXStarz
New Scratcher
8 posts

Scratch Count

But how do you make it count from 1 through 20 and when I choose the blocks that you put it says that 1.5 (ex) is an integer
Specter22
Scratcher
100+ posts

Scratch Count

DreamsXStarz wrote:

But how do you make it count from 1 through 20 and when I choose the blocks that you put it says that 1.5 (ex) is an integer
Check this out http://scratch.mit.edu/projects/32049778/
Photoguy77
Scratcher
100+ posts

Scratch Count

Hi! What you'll need is a a script that will not check for decimals, but only whole numbers. I hope this helps!
When gf clicked
ask [Hi! Tell me a number between one and twenty.] and wait
set [i v] to [0]
set [correct v] to [false]
repeat (20)
if <(answer) = (i)>//if the number the user entered ( the answer variable ) is equal to the counter ( i ), then we tell the system
//that the user is right.
set [corrrect v] to [true]
broadcast [check answer v]
stop [this script v]//this will stop the script from running after the correct answer is found. this will save time so the script is not
// repeating after the correct answer is found
end
change [i v] by (1)
end

when I receive [check answer v]
if <(correct) = [true]>
say [Nice Job! Press the green flag to try again.]
else
say [That's not quite right! Press the green flag to try again]
end
DreamsXStarz
New Scratcher
8 posts

Scratch Count

@specter22 I got that part done, thank you but then everything is mixed up. one question works while the other doesn't. Should I publish it to show you what I mean??

@photoguy77 it needs to be put in one whole line and a check answer correct response
Specter22
Scratcher
100+ posts

Scratch Count

DreamsXStarz wrote:

@specter22 I got that part done, thank you but then everything is mixed up. one question works while the other doesn't. Should I publish it to show you what I mean???

@photoguy77 it needs to be put in one whole line and a check answer correct response

Yes Please Do

Last edited by Specter22 (Oct. 31, 2014 05:19:50)

Powered by DjangoBB