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

#1 2012-10-14 08:54:52

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

If if if ... else

How do you create something that makes it do multiple ifs and then an else.

So for example...

if <>
[


if <>
[


if <>
[

else
[


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#2 2012-10-14 09:05:33

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: If if if ... else

Depends on what you mean. You can use

if <>
end
if <>
end
if <>
else
end
or
if <>
else
 if <>
 else
  if <>
  else
  end
 end
end
depending on what you want.  smile

Offline

 

#3 2012-10-14 09:22:37

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

Re: If if if ... else

What I meant was like
multiple if's, and then an else, so if the if happens, it does that, but if it doesn't happen, it goes to else  tongue


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#4 2012-10-14 09:43:07

northmeister
Scratcher
Registered: 2011-07-12
Posts: 1000+

Re: If if if ... else

You mean this?

if<(something)and<(something)and<(something)and(something)>>>
 do something
else
 do something else
end

Last edited by northmeister (2012-10-14 09:44:43)


http://i48.tinypic.com/5a25g5.png

Offline

 

#5 2012-10-14 09:43:28

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: If if if ... else

funelephant wrote:

What I meant was like
multiple if's, and then an else, so if the if happens, it does that, but if it doesn't happen, it goes to else  tongue

I think what you need is:

if <<(1) and (1)> and <(1) and (1)>>//The 1 is there just to hold the place.
else
end


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer