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

#1 2010-03-21 16:01:55

addy107
Scratcher
Registered: 2009-01-10
Posts: 94

Numbers fit in << something <or> something >>

I got annoyed because i work on something and i need this
Example:
<< 1 <or> 2 >>


*Knock knock*/Whos there?/Scratch!/Scratch who?/Scratch Cat!

Offline

 

#2 2010-03-21 16:09:11

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Numbers fit in << something <or> something >>

If the number is a variable, you can always just do

<if><< <( <{ number }> <=> 1 )> <or> <( <{ number }> <=> 2 )> >>[/blocks].

Last edited by hmnwilson (2010-03-21 16:09:35)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#3 2010-03-21 16:11:14

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: Numbers fit in << something <or> something >>

http://gershmer.net/script.gif

You mean like this?

(replace one var with var2 I was in a rush  sad )

Last edited by gershmer (2010-03-21 16:13:06)


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#4 2010-03-21 21:20:26

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Re: Numbers fit in << something <or> something >>

I see what he means. It's annoying and inelegant.

Offline

 

#5 2010-03-21 21:45:49

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Numbers fit in << something <or> something >>

Tell me. When would you need that?


Hai.

Offline

 

#6 2010-03-21 23:24:23

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Numbers fit in << something <or> something >>

fg123 wrote:

Tell me. When would you need that?

I think he or she means doing something like this: http://img195.imageshack.us/img195/1617/97693011.gif
It isn't necessary.

Last edited by scmb1 (2010-03-21 23:25:14)


http://i48.tinypic.com/2z5pqad.png

Offline

 

#7 2010-03-22 00:26:31

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Numbers fit in << something <or> something >>

Make a list, called whatever you want. Put 1, and 5 in it. Then,

if score = item any of (list name)

Works only offline though...  hmm


Hai.

Offline

 

#8 2010-03-22 00:28:06

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Numbers fit in << something <or> something >>

fg123 wrote:

Make a list, called whatever you want. Put 1, and 5 in it. Then,

if score = item any of (list name)

Works only offline though...  hmm

Then there is a 1 in 2 chance of 1 and 5, so there is a half chance that it will work. Not very good.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#9 2010-03-22 00:47:47

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Numbers fit in << something <or> something >>

Greatdane wrote:

fg123 wrote:

Make a list, called whatever you want. Put 1, and 5 in it. Then,

if score = item any of (list name)

Works only offline though...  hmm

Then there is a 1 in 2 chance of 1 and 5, so there is a half chance that it will work. Not very good.

Nope. It will always work with as many items as you want. Go try it.


Hai.

Offline

 

#10 2010-03-22 00:59:26

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Numbers fit in << something <or> something >>

Couldn't you just do the bother of this?  hmm

if variable = 1 or variable = 2
   code
endif

Or am I confused...?


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer