Discuss Scratch
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
is what it would look like. Now here's an example of what it does:if <(flash?) = [1]> and stop script if not
show
repeat (flash #)
change [color v] effect by (10)
end
end
hide
That would mean that if the variable flash?'s value was 1, it would change the color effect by 10, and repeat this as many times as the value of the variable flash #. But with one exception: As soon as the variable flash?'s value was not 1, it would immediately stop changing the color effect by 1, and hide.
Any workarounds?
Last edited by Scratch12300 (Aug. 3, 2013 14:02:31)
- ProdigyZeta7
-
Scratcher
1000+ posts
New "if <> then" block.
*megafacepalm* It's too easy to make.
if <boolean> then
...
else
stop [this script v]
- Chainmanner
-
Scratcher
100+ posts
New "if <> then" block.
That's not really needed. After all, instead of programming a new block that says
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]
That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
- turkey3
-
Scratcher
1000+ posts
New "if <> then" block.
I think I know what you're saying. Like an “Exit Loop” block? That'd be useful, but there's workarounds.*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
Yes, that's what I'm saying. What are the workarounds?I think I know what you're saying. Like an “Exit Loop” block? That'd be useful, but there's workarounds.*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
- dvd4
-
Scratcher
100+ posts
New "if <> then" block.
Yes, that's what I'm saying. What are the workarounds?I think I know what you're saying. Like an “Exit Loop” block? That'd be useful, but there's workarounds.*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
stop [script v]
- mythbusteranimator
-
Scratcher
1000+ posts
New "if <> then" block.
It is really easy just to exit a script…*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
NO. I mean only stop the script inside the if <> then block!Yes, that's what I'm saying. What are the workarounds?I think I know what you're saying. Like an “Exit Loop” block? That'd be useful, but there's workarounds.*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.Thought it would be unusable in 1s1s…stop [script v]
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
Okay. How?It is really easy just to exit a script…*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.
- dvd4
-
Scratcher
100+ posts
New "if <> then" block.
not happy with that solution eh ? I think you'll be happy with this one…NO. I mean only stop the script inside the if <> then block!Yes, that's what I'm saying. What are the workarounds?I think I know what you're saying. Like an “Exit Loop” block? That'd be useful, but there's workarounds.*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.Thought it would be unusable in 1s1s…stop [script v]
block
if <not<condition>>
{
block
if<not<condition>>
{
block
}
}
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
Thank you! But if you have a very loooooong script inside the if <> then block, it's easier to have what I'm suggesting.not happy with that solution eh ? I think you'll be happy with this one…NO. I mean only stop the script inside the if <> then block!Yes, that's what I'm saying. What are the workarounds?I think I know what you're saying. Like an “Exit Loop” block? That'd be useful, but there's workarounds.*megafacepalm* It's too easy to make.if <boolean> then
...
else
stop [this script v]That's not really needed. After all, instead of programming a new block that saysNo no no no no no and no. I meant stop the script inside the if <> then block! If you thought I meant stop the whole script, then I agree, *megafacepalm*.
if <var = true>
do something
else say “m00ph454”
you can just have it like this:
if <var = true>
do something
else
stop
I mean, come on now, it's just one block. It's not even commonly used.Thought it would be unusable in 1s1s…stop [script v]geddit ?block
if <not<condition>>
{
block
if<not<condition>>
{
block
}
}
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
BUMP
Last edited by Scratch12300 (July 30, 2013 19:26:34)
- Scratch12300
-
Scratcher
500+ posts
New "if <> then" block.
PMUB
Last edited by Scratch12300 (July 30, 2013 19:26:25)
- scimonster
-
Scratcher
1000+ posts
New "if <> then" block.
Sorry, but i think it would be very rarely used, so i don't support.
not happy with that solution eh ? I think you'll be happy with this one…Actually, it should be if <condition>, because you want it to run when true.geddit ?block
if <not<condition>>
{
block
if<not<condition>>
{
block
}
}
- drmcw
-
Scratcher
1000+ posts
New "if <> then" block.
If I'm understanding what you mean correctly then you're really confusing what an if statement does. The if then statement is a branching statement so the boolean value is calculated and if true then the script inside the if then is run. The boolean value is not evaluated again. Ok you may then argue that because if then doesn't re-evaluate the boolean at each point within its enclosing script that your idea should be adopted, I'm afraid I'd have to say that it'd confuse everyone and as you've seen there are workarounds which wouldn't confuse.
- Zparx
-
Scratcher
500+ posts
New "if <> then" block.
If I'm understanding what you mean correctly then you're really confusing what an if statement does. The if then statement is a branching statement so the boolean value is calculated and if true then the script inside the if then is run. The boolean value is not evaluated again. Ok you may then argue that because if then doesn't re-evaluate the boolean at each point within its enclosing script that your idea should be adopted, I'm afraid I'd have to say that it'd confuse everyone and as you've seen there are workarounds which wouldn't confuse.
I agree. If a boolean renders false, it won't execute the scripts inside the if block, much like your suggestion. The difference between your suggestion and a regular true/false boolean are so small that it won't matter enough to implement. It's good that you're brainstorming, though! Scratch definitely needs new ideas (:
Last edited by Zparx (July 30, 2013 20:14:47)
- PERCE-NEIGE
-
Scratcher
100+ posts
New "if <> then" block.
No offense, but I think you don't know how to use the “if” block.
You have to code with the “if… else” block
IF
—do this
ELSE
—stop this script
So, it's totally useless, because that's already exist in another form.
Scratch is made to give you basic block that exist in most of the programming language, this kind of block you ask for, I never see it in any of them, (tell me if I'm wrong)
You have to code with the “if… else” block
IF
—do this
ELSE
—stop this script
So, it's totally useless, because that's already exist in another form.
Scratch is made to give you basic block that exist in most of the programming language, this kind of block you ask for, I never see it in any of them, (tell me if I'm wrong)










