This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-11-02 05:50:06

damirAERO
New Scratcher
Registered: 2011-10-23
Posts: 5

help !

Hi to all, i need a litlle help. I have to do next task: a character will imagine one number between 1 and 100 and i have to give a correct answer. Can u give me some help in this ?

Offline

 

#2 2011-11-02 06:03:27

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: help !

damirAERO wrote:

Hi to all, i need a litlle help. I have to do next task: a character will imagine one number between 1 and 100 and i have to give a correct answer. Can u give me some help in this ?

eh...
when green flag clicked
ask pick a number between 1 and 100
if (answer) = (pick random 1 to 100) [
say you got it right!
]


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#3 2011-11-02 06:09:06

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: help !

WindowsExplorer wrote:

damirAERO wrote:

Hi to all, i need a litlle help. I have to do next task: a character will imagine one number between 1 and 100 and i have to give a correct answer. Can u give me some help in this ?

eh...
when green flag clicked
ask pick a number between 1 and 100
if (answer) = (pick random 1 to 100) [
say you got it right!
]

That's a good way, but if you want to save the random number, use this:

Code:

when green flag clicked
set [random number^] to (pick random (1) to (100))
ask [pick a number between 1 and 100]
if <(answer) = (random number)> {
say [you got it right!]
}

Offline

 

#4 2011-11-02 12:43:28

iTweak0r
Scratcher
Registered: 2011-07-30
Posts: 100+

Re: help !

damirAERO wrote:

Hi to all, i need a litlle help. I have to do next task: a character will imagine one number between 1 and 100 and i have to give a correct answer. Can u give me some help in this ?

when green flag clicked
Ask I have a number between 1 and 100, type in your guess
If answer = pick random from 1 to 100
Say correct!
Else
Say Wrong.


Make it in Scratch! because it's cooler when it's made in scratch
http://i.imgur.com/D4iqPHR.png

Offline

 

Board footer