Discuss Scratch
- Discussion Forums
- » Suggestions
- » Boolean variables.
- Splashmasters
-
15 posts
Boolean variables.
Variables are used for a lot of stuff. Especially numbers. But wouldn't it be fun to have an standard boolean? So for example: An variable with the name “Is Cat” would normally say “0”, but that doesn't make any sense because it is a yes or no question, not a numberic question. So add an checkbox named “Boolean” and a description saying “Instead of numbers, uses true or false.” This, when paired with on cloud, should be used as extra or less score on the leaderboard, thus should have an other variable attached to it with cloud enabled too and an number adding or subtracting the score. That way, code can be shortened and new players have ease with variables.
Edit: Yes, I know that you could already do so, but… it's just shortening code and makes it default “false”
Here is an example for code before:
Edit: Yes, I know that you could already do so, but… it's just shortening code and makes it default “false”
Here is an example for code before:
Last edited by Splashmasters (June 16, 2024 14:52:55)
- hydrofungus
-
1000+ posts
Boolean variables.
Doesn’t the operator blocks already do this? (The <, > and = ones)
You can do like, for example 0 is false and 1 is true
You can do like, for example 0 is false and 1 is true
Last edited by hydrofungus (June 15, 2024 09:53:07)
- hydrofungus
-
1000+ posts
Boolean variables.
my custom blocks pack named backblocks. Also I know workaround:That workaround doesn’t exist? Support, beacuse it can expand
- medians
-
1000+ posts
Boolean variables.
But it does?my custom blocks pack named backblocks. Also I know workaround:That workaround doesn’t exist? Support, beacuse it can expand
Anyways, already suggested:
https://scratch.mit.edu/discuss/post/59944/
- julmik6478
-
500+ posts
Boolean variables.
Duplicate of https://scratch.mit.edu/discuss/topic/8618/
Easier version: Doesn’t the operator blocks already do this? (The <, > and = ones)
You can do like, for example 0 is false and 1 is true
Last edited by julmik6478 (June 16, 2024 07:55:34)
- Splashmasters
-
15 posts
Boolean variables.
Yes, I already know you just can do this:
If it would be at default like this:
But it is at default just 0.
If it would be at default like this:
Then it would save some space (i think) and this could shorten code, especially for other variables
- Discussion Forums
- » Suggestions
-
» Boolean variables.