Discuss Scratch

Ekrcoaster
Scratcher
18 posts

Add Switch Blocks to Scratch

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!

Last edited by Ekrcoaster (March 14, 2017 16:02:18)


–Ekrcoaster

Talk to an Artificial Intelligence I made! Meet Jova!

when I receive [morning v]
repeat until <(time) = [night]>
broadcast [code all day v]
end
stop [this script v]
marscratcher
Scratcher
100+ posts

Add Switch Blocks to Scratch

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

Marscratcher
Ekrcoaster
Scratcher
18 posts

Add Switch Blocks to Scratch

marscratcher wrote:

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

I totally agree! It would be cool because it would add a new block and would simplify the script because it uses a number string rather then a Boolean.

–Ekrcoaster

Talk to an Artificial Intelligence I made! Meet Jova!

when I receive [morning v]
repeat until <(time) = [night]>
broadcast [code all day v]
end
stop [this script v]
marscratcher
Scratcher
100+ posts

Add Switch Blocks to Scratch

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

I totally agree! It would be cool because it would add a new block and would simplify the script because it uses a number string rather then a Boolean.
Oh i get it. I had an idea that you could right click and change how many “else” there are.

Last edited by marscratcher (March 15, 2017 01:53:31)


Marscratcher
Ekrcoaster
Scratcher
18 posts

Add Switch Blocks to Scratch

marscratcher wrote:

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

I totally agree! It would be cool because it would add a new block and would simplify the script because it uses a number string rather then a Boolean.
Oh i get it. I had an idea that you could right click and change how many “else” there are.

Great Idea! In Java that is how it works! Maybe they would add a plus sign at the bottom, in java you just type a new line of the case….

–Ekrcoaster

Talk to an Artificial Intelligence I made! Meet Jova!

when I receive [morning v]
repeat until <(time) = [night]>
broadcast [code all day v]
end
stop [this script v]
marscratcher
Scratcher
100+ posts

Add Switch Blocks to Scratch

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

I totally agree! It would be cool because it would add a new block and would simplify the script because it uses a number string rather then a Boolean.
Oh i get it. I had an idea that you could right click and change how many “else” there are.

Great Idea! In Java that is how it works! Maybe they would add a plus sign at the bottom, in java you just type a new line of the case….
This would actually be very useful with he pen coding I'm doing now.

Marscratcher
jromagnoli
Scratcher
1000+ posts

Add Switch Blocks to Scratch

marscratcher wrote:

-snip-
Then it would be a duplicate topic.




ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

Ekrcoaster
Scratcher
18 posts

Add Switch Blocks to Scratch

marscratcher wrote:

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

I totally agree! It would be cool because it would add a new block and would simplify the script because it uses a number string rather then a Boolean.
Oh i get it. I had an idea that you could right click and change how many “else” there are.

Great Idea! In Java that is how it works! Maybe they would add a plus sign at the bottom, in java you just type a new line of the case….
This would actually be very useful with he pen coding I'm doing now.

Cool! I really hope they add this

–Ekrcoaster

Talk to an Artificial Intelligence I made! Meet Jova!

when I receive [morning v]
repeat until <(time) = [night]>
broadcast [code all day v]
end
stop [this script v]
braxbroscratcher
Scratcher
1000+ posts

Add Switch Blocks to Scratch

marscratcher wrote:

Ekrcoaster wrote:

marscratcher wrote:

Ekrcoaster wrote:

So while I was learning Java, I came acrossed a switch that java has that works like this:

You enter a number to a value such as (2) and then java would run the 2nd code in the script. Confused? So am I!

Example:

when green flag clicked
if (2) then

first function

else

second function (This one will run!)
Use an = block and a variable/custom block.

else

third function


end

Here is more information to hopefully make it less confusing

LESS CONFUSING JAVA TUTORIAL!

I know it would be the same as a bunch of if else blocks but it would be cool!
You can just do:
if <1> then 

func. 1

else
if <2> then

func. 2

else
func. 3
end
end

I totally agree! It would be cool because it would add a new block and would simplify the script because it uses a number string rather then a Boolean.
Oh i get it. I had an idea that you could right click and change how many “else” there are.


My signature is kumquat proof.
But not tangerine pro-
nomnomnomnomnom










Current Project:
n/a
Quotes: “In our last hour, we burn the most brightly, trying to deny that we are burning out.” -Me
“Well, no. 1024 Killerbytes make a Murderbyte.” -MegaByteCorporations
“I hate out of context quotes.” -Me
“I hate it when Cubeupload breaks.” -Also me
stickfiregames
Scratcher
1000+ posts

Add Switch Blocks to Scratch

This is a duplicate.










If you can read this, my signature cubeupload has been eaten by an evil kumquat!




or you just used Inspect Element, you hacker

;
Paddle2See
Scratch Team
1000+ posts

Add Switch Blocks to Scratch

stickfiregames wrote:

This is a duplicate.
Thanks for the link! It does look like this is a duplicate topic so I'll close it to keep the conversation all in one place.

Please use the existing topic in the link above.

Scratch Team Member, kayak and pickleball enthusiast, cat caregiver.

This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.
(credit to Za-Chary)



;

Powered by DjangoBB