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

#1 2009-11-03 14:17:49

Maki-Tak
Scratcher
Registered: 2008-03-10
Posts: 100+

Switches

Yep.

I'm not sure if this has been suggested before, but I personally think it would be really useful.

Basically it's a kind of variable, which can "switch" on and off.

Example:

<when__clicked>
<turn__ON>

<whenIrecieve___>
<turn__OFF>

<If__=ON>
<broadcast__>


I'm not exactly sure where this would lead but I'm hoping people could take it further.


http://i.cubeupload.com/zZE0XJ.png

Offline

 

#2 2009-11-03 14:21:54

jacool
Scratcher
Registered: 2008-01-25
Posts: 1000+

Re: Switches

I've been thinking about this too  big_smile

I think that it would be good if you could choose to make a variable which only can store 1 bits of data.
Then use the switch function to toggle the value...

This function exists in many other programming languages and it would be very useful in Scratch!


http://i571.photobucket.com/albums/ss159/JacobKar/svensktiger-1.png

Offline

 

#3 2009-11-06 20:10:22

qwertyperson
Scratcher
Registered: 2009-10-13
Posts: 11

Re: Switches

I found out that vars can store true/false by putting a Boolean block inside.

Offline

 

#4 2009-11-06 22:24:38

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Switches

So you basically want a boolean block. Yeah that would be really nice. That way it only serves the true/false purpose you want, and takes up less memory.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#5 2009-11-07 00:17:40

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Switches

You can do this really easily with setting the variable (or using a special variable for the on and off stuff). So no... and it's not neccessary.


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#6 2009-11-07 18:17:45

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

Re: Switches

That could be useful.


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

Offline

 

#7 2009-11-07 18:21:56

Ssbrawl700
Scratcher
Registered: 2009-02-11
Posts: 100+

Re: Switches

Jonathanpb wrote:

You can do this really easily with setting the variable (or using a special variable for the on and off stuff). So no... and it's not neccessary.

Yeah u can just make a variable called on/off or something else if u like.

1=on
0=off

or vice versa

That's why on power buttons there are two symbols that look like a 1 and a 0. They represent on/off.


Can you beat the ever-so challenging Keyboard Khaos?

Offline

 

Board footer