Discuss Scratch

codeman1044
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

Is this topic an open poll for workarounds for requested features?

I couldn't help it, although it was kind of a stretch…


I'm not even sorry

This is my signature, which shows up every time I post and is automatic.
I'm not going to be as active anymore…
I am a bot, and this action was performed automatically. Just kidding! Fake news!.
Last signature edit: June 17th, 2020 1000th post
I like being formal, though I'm usually not formal anywhere but here. Sorry if I come across as harsh, as I don't intend to.
Check out my perfect tutorials and stuff!
openPoll
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

codeman1044 wrote:

Is this topic an open poll for workarounds for requested features?

I couldn't help it, although it was kind of a stretch…


I'm not even sorry
Wow. Just wow.

But not really. More like a list instead of a poll

Moi? Whaddya wahnt from moi?

——

Inactive Scratcher • making memes wen??? • define defineI use DiscordI have Robux >:)1,000+ hours on Splatoon 2 • 250+ hours on Pokémon White • 100+ hours on MinecraftAn 8 bit remix I love • i have lots game • too lazy to make rainbows • still a proud Windows 7 user
DaEpikDude
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

Workaround for an <if <…> then <…>> boolean block:

Za-Chary wrote:

It's subtle, but there is a relatively simple workaround.

<<not <> > or <> >

When you write this:

<if <boolean A> then <boolean B> ::control>

It is always true unless “boolean A” is true and “boolean B” is false. Similarly:

<<not <boolean A> > or <boolean B> >

If “boolean A” is false, then the entire boolean would be true due to the “or” statement. If “boolean A” is true, then we need “boolean B” to be true in order for the boolean to be true (otherwise, it's false). In other words, this boolean is always true unless “boolean A” is true and “boolean B” is false.

Applying this logic to the example you gave might make more sense.

-Reshiram-
Scratcher
100+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

oof nevermind my post b r o k e

Last edited by -Reshiram- (Aug. 5, 2019 19:26:48)


Sayonara! You won't find me active here anymore — try Arceu.
Mr_PenguinAlex
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

DaEpikDude wrote:

Workaround for an <if <…> then <…>> boolean block:

Za-Chary wrote:

-snip-
r.i.p my suggestion

Highlight part of my signature, press CTRL + SHIFT + DOWN ARROW KEY to see the rest of it!
If I don't respond to your post on the Suggestions forums, I probably couldn't think of an answer.

A quote from Za-Chary for you mini-mods and forum helpers:

Za-Chary wrote:

And, at the very least, I would discourage others from telling people that they have “blockspammed” in the forums. If it really is spam, just use the Report button and move on. To any forum helper / mini-mod who reads this, when you come across a necropost, I'd suggest doing nothing and instead maybe reporting the topic. If there doesn't appear to be a need for the topic to remain open, ask for it to be closed within the report.I suggest that, instead of trying to respond to these users asking them not to necropost, that you just use the Report button and ask us to take it down due to spam.

I'm Mr_PenguinAlex, a person who enjoys difficult games, and sometimes doesn't include capitals or punctuation in my forum posts for no reason!
WindOctahedron
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

[] starts with []? :: operators boolean
The workaround:
define check if (string) starts with (letters)
set [i v] to (1)
set [output v] to []
repeat (length of (letters :: custom arg))
if <not <(letter (i) of (string :: custom arg)) = (letter (i) of (letters :: custom arg))>> then
set [output v] to [false]
end
if <not <(output) = [false ]>> then
change [i v] by (1)
if <[i v] > (length of (letters :: custom arg))> then
set [output v] to [true]
end
end
Taken from here. @hedgehog_blue posted another workaround:
define does (word) start with (letters)?
set [number v] to (1)
set [result v] to [unknown]
repeat (length of (letters :: custom arg))
if <not<(letter (number) of (letters :: custom arg))=(letter (number) of (word :: custom arg))>> then
set [result v] to [false]
stop [this script v]
end
change [number v] by (1)
end
set [result v] to [true]

Last edited by WindOctahedron (Aug. 27, 2019 15:50:55)


This post is brought to you by WindOctahedron's brain
Look Listen, it even made some music.
Be moist so you can feel cool when my wind blows.
lunaraemaemae
Scratcher
50 posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

prievios costume is in the set costume block.

(^_^)   
this is my kumquat killer.STRIKE THAT DEMON DOWN PAPYRUS!!!!
DaEpikDude
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

<<A> xor <B>::operators>
can also be workarounded as
<not <<A> = <B>>>
A xor B returns true if one, but not both, of A and B are 1: i.e. A and B are different.
This would also return true only if A and B are both different.

(slightly shorter than “(A or B) and not (A and B)”)

Computer_Fizz
Scratcher
100+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

Better way to make a “when stop sign clicked”
when @greenFlag clicked
forever
set [timer v] to (timer)
end

when [timer v] > (timer :: variables)
. . .
Better way to make a “when <boolean>”
when [timer v] > (timer :: variables)
if <. . .> then
broadcast [WhenBoolean v]
end
set [timer v] to (timer)

I don't understand the “move up 10 steps” one though… that the regular “move 10 steps” moves in the direction the sprite is pointing?

Last edited by Computer_Fizz (Sept. 25, 2019 19:56:09)

kChiaEC19
Scratcher
500+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

My workaround for a suggested block
(which keys pressed? :: sensing)
:
https://scratch.mit.edu/projects/328947478/

Inspired by Mr_PenguinAlex and coder2045.
What's wrong with these blocks? There are zero mistakes, because no round has started yet.
// No round has started yet.
Be the first to answer correctly all of the mistakes on my profile and you'll get a love!
kChiaEC19
Scratcher
500+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

DaEpikDude wrote:

<<A> xor <B>::operators>
can also be workarounded as
<not <<A> = <B>>>
A xor B returns true if one, but not both, of A and B are 1: i.e. A and B are different.
This would also return true only if A and B are both different.

(slightly shorter than “(A or B) and not (A and B)”)
I think this is better:
<not <<not <<A> or <B>>> or <<A> and <B>>>>

Inspired by Mr_PenguinAlex and coder2045.
What's wrong with these blocks? There are zero mistakes, because no round has started yet.
// No round has started yet.
Be the first to answer correctly all of the mistakes on my profile and you'll get a love!
WindOctahedron
Scratcher
1000+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

kChiaEC19 wrote:

DaEpikDude wrote:

<<A> xor <B>::operators>
can also be workarounded as
<not <<A> = <B>>>
A xor B returns true if one, but not both, of A and B are 1: i.e. A and B are different.
This would also return true only if A and B are both different.

(slightly shorter than “(A or B) and not (A and B)”)
I think this is better:
<not <<not <<A> or <B>>> or <<A> and <B>>>>
I disagree, it's longer (and therefore slower to calculate).

This post is brought to you by WindOctahedron's brain
Look Listen, it even made some music.
Be moist so you can feel cool when my wind blows.
Computer_Fizz
Scratcher
100+ posts

(Wanting block workarounds posted!) The Ultimate List of Workarounds and More ②.⓪

Note: This thread is now replaced by this one in the stickies. I have also requested this thread to be closed to keep all the discussion in one place.

Powered by DjangoBB

Standard | Mobile