Discuss Scratch
- Discussion Forums
- » Suggestions
- » ≥ and ≤ in operators
- notumbre
- Scratcher
3 posts
≥ and ≤ in operators
I'm relatively new to Scratch, however, I think I may have a suggestion.
I checked about 75 pages of suggestions until my eyes bled, and I didn't see this suggestion, the greater or equal to green thing (again, I'm fairly new to Scratch), the lesser of equal to green thing, and a plus-minus (±) symbol, or maybe a thing to test if a number falls in between 2 parameters (ie: ‘if within _ and _’).
meme
I checked about 75 pages of suggestions until my eyes bled, and I didn't see this suggestion, the greater or equal to green thing (again, I'm fairly new to Scratch), the lesser of equal to green thing, and a plus-minus (±) symbol, or maybe a thing to test if a number falls in between 2 parameters (ie: ‘if within _ and _’).
meme
- stickfire-test
- Scratcher
100+ posts
≥ and ≤ in operators
≤ ≥ and ≠ are already suggested here. I usually semi-support those because while they are easily workaroundable they are also basic operators in nearly every programming language.
± is impossible because a reporter can only report a single value, not several, and a “between” block is easy to workaround.
± is impossible because a reporter can only report a single value, not several, and a “between” block is easy to workaround.
Last edited by stickfire-test (Jan. 13, 2017 18:05:23)
- theonlygusti
- Scratcher
1000+ posts
≥ and ≤ in operators
What does your ± block do? Because it normally means either the negative or positive value of the operand, but a reporter in Scratch cannot output two values.
Also, normally it's recommended to create one topic per idea.
Also, normally it's recommended to create one topic per idea.
- braxbroscratcher
- Scratcher
1000+ posts
≥ and ≤ in operators
No support. Use the <<> or <>> blocks or the <not <>> blocks.
My signature is kumquat proof.
But not tangerine pro-
nomnomnomnomnom
- The4thPixel
- Scratcher
1000+ posts
≥ and ≤ in operators
No support. The workarounds aren't that hard.
EDIT: These workarounds only support whole numbers, see below for a workaround that should work for every kind of number.
<(number1) > ((number2) - (1))> // more than or equal to
<(number1) < ((number2) + (1))> // less than or equal to
EDIT: These workarounds only support whole numbers, see below for a workaround that should work for every kind of number.
Last edited by The4thPixel (Jan. 13, 2017 22:28:52)
- jromagnoli
- Scratcher
1000+ posts
≥ and ≤ in operators
No support. Easy workaround:
<<(foo) < [-1]> or <(foo) = [-1]>>Very easy. This is like suggesting a block like this:
<<(foo) > [-1]> or <(foo) = [-1]>>
key [w v] pressed? or key [up arrow v] pressed? :: sensing booleanwhich has an easy workaround as well.
- The4thPixel
- Scratcher
1000+ posts
≥ and ≤ in operators
This is a slightly easier alternative for my workaround above. No support. Easy workaround:<<(foo) < [-1]> or <(foo) = [-1]>>
<<(foo) > [-1]> or <(foo) = [-1]>>
- stickfiregames
- Scratcher
1000+ posts
≥ and ≤ in operators
Your workaround above only works for whole numbers.This is a slightly easier alternative for my workaround above. No support. Easy workaround:<<(foo) < [-1]> or <(foo) = [-1]>>
<<(foo) > [-1]> or <(foo) = [-1]>>
The shortest workaround is
<not <[] > []>>
<not <[] < []>>
Last edited by stickfiregames (Jan. 13, 2017 22:08:03)
- The4thPixel
- Scratcher
1000+ posts
≥ and ≤ in operators
I just added a note to my first post, thank you for noticing that flaw. Your workaround above only works for whole numbers.
The shortest workaround is<not <[] > []>>
<not <[] < []>>
- jromagnoli
- Scratcher
1000+ posts
≥ and ≤ in operators
Who's? His? I have tested mine before. Your workaround above only works for whole numbers.
The shortest workaround is<not <[] > []>>
<not <[] < []>>
- The4thPixel
- Scratcher
1000+ posts
≥ and ≤ in operators
I think they're referring to my workaround since I tested it and it doesn't work for whole numbers.Who's? His? I have tested mine before. Your workaround above only works for whole numbers.
The shortest workaround is<not <[] > []>>
<not <[] < []>>
- ChatUser2
- Scratcher
100+ posts
≥ and ≤ in operators
I remember ± inverting sign in calculators, which can be done already with
(() - (number)) // empty is 0
((-1) * (number))
((number) / (-1))
My cloud draw project (64x64, 12 colors): https://scratch.mit.edu/projects/147125133/
- ChatUser2
- Scratcher
100+ posts
≥ and ≤ in operators
There's always right-click+help.Or anyone who hasn't done a high enough math level. No support. Do you really want a[]=>[]::boolean operatorswhen you can just take 2 Blocks and go<not <[] < [ ]>>?
Plus, it would be confusing to new scratchers.
No support as per workarounds.
My cloud draw project (64x64, 12 colors): https://scratch.mit.edu/projects/147125133/
- theonlygusti
- Scratcher
1000+ posts
≥ and ≤ in operators
I don't feel there's really a gaping void in Scratch due to this block's absence. By learning to recreate non-built-in mathematical operators users are becoming better programmers and logicians.
- Ninkancho
- Scratcher
500+ posts
≥ and ≤ in operators
I actually support this idea. It's a frequent suggestion that I even made once myself, and I can list and argue multiple reasons why it's worth having.
This post may come off as a bit inflammatory to some, but I think it's time we give this suggestion the chance and consideration it deserves, and that means taking down the roadblocks.
- The lack of these blocks is confusing. Do you want to know why this topic has been posted over and over again throughout the years? It's because many Scratchers do know about the composite -or-equal-to operators, and are confused by their absence. I would argue that adding these blocks would make booleans more accessible to New Scratchers, or at least no more confusing than our existing comparator blocks already are.
- Popular languages have these as a basic feature. Scratch is supposed to be a preparation for other programming languages. Why, then, does it not comply with the standard of including -or-equal-to inequalities as booleans? The argument could be made that leaving out these operators is actually setting programming novices up for failure. Every equality and inequality boolean is important, and ignoring two will lead to less efficient code. It still works, but it takes so much more effort when a single operator for the task already exists.
- The workaround is more confusing than the suggestion. I always see replies on these threads that are saying at least one of two things: that the suggestion is confusing, and that it should be no-supported because there's an easy workaround. The thing is, this workaround is obtuse and unintuitive. It requires a leap of lateral thinking not only to realize for oneself that inverting the output of the opposite existing operator reports the desired output (which most people won't, hence why they ask for the tools they're familiar with on these forums), but why this works at all. You first need to fully understand how booleans work, then mentally apply them as sort-of Euclidean vectors on a number line. At least with the blocks being suggested, the answer is in the name of the symbol! And therein lies the usefulness.
But more to the point, this not-notation that's needed for the workaround just muddles the code, and can make complicated booleans just that much harder to figure out, even when you know what the workaround means and does. At first glance, there's always the chance that you'll only see the opposite of what you get. With the booleans being suggested, you'll learn what they mean once if you don't already know. But the workaround, with its doubly-backwards operators, requires you to stop and think through the intended result every time, even if for a fraction of a second; and then remember it as the result isn't clearly stated in the code.
This post may come off as a bit inflammatory to some, but I think it's time we give this suggestion the chance and consideration it deserves, and that means taking down the roadblocks.
Ninkancho STUDIO • ☁️ Cloud Clicker DEMO
Let's Play Together • Another Rather Unremarkable Platformer • Sinewarper
public class Scrape{public static void main(String[] args){Scrape myScrape=new Scrape();myScrape.eternally{myScrape.picture();myScrape.write();myScrape.tell();}}}
Windows NT 10.0, Chrome 51.0.2704.79, Flash 23.0 (release 0)), Flash 23.0 (release 0)
kajquats;
- jromagnoli
- Scratcher
1000+ posts
≥ and ≤ in operators
The workaround is simple. Took me 5 seconds to think up. Why would it be complicated? It doesn't require lateral thinking. Anyway, I just wanted to know why you think it is so complicated? Sure, it is a lacking feature in scratch, but I feel we don't really need it. -snip-
The workaround is more confusing than the suggestion. I always see replies on these threads that are saying at least one of two things: that the suggestion is confusing, and that it should be no-supported because there's an easy workaround. The thing is, this workaround is obtuse and unintuitive. It requires a leap of lateral thinking not only to realize for oneself that inverting the output of the opposite existing operator reports the desired output (which most people won't, hence why they ask for the tools they're familiar with on these forums), but why this works at all. You first need to fully understand how booleans work, then mentally apply them as sort-of Euclidean vectors on a number line. At least with the blocks being suggested, the answer is in the name of the symbol! And therein lies the usefulness.
But more to the point, this not-notation that's needed for the workaround just muddles the code, and can make complicated booleans just that much harder to figure out, even when you know what the workaround means and does. At first glance, there's always the chance that you'll only see the opposite of what you get. With the booleans being suggested, you'll learn what they mean once if you don't already know. But the workaround, with its doubly-backwards operators, requires you to stop and think through the intended result every time, even if for a fraction of a second; and then remember it as the result isn't clearly stated in the code.
- gems89
- Scratcher
1000+ posts
≥ and ≤ in operators
It would be nice to have that, but if you do the right then it should not be to hard
Semi-Support.
Semi-Support.
- analogclock
- Scratcher
100+ posts
≥ and ≤ in operators
FULL SUPPORT As a matter of fact, I was just thinking today that I would suggest that myself!
“Truly wonderful, the mind of a child is.”
-Grand Master Yoda
- Discussion Forums
- » Suggestions
- » ≥ and ≤ in operators