Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » colorless sprites
- MultiGrainOats
- Scratcher
20 posts
colorless sprites
My browser / operating system: ChromeOS 13421.102.0, Chrome 86.0.4240.199, No Flash version detected
i came across a bug (im not sure if its a bug or if its supposed to do it) while changing the color of my sprite. i wanted to see what would happen if i did the script that is down below. then it turned my sprite entirely black and white! im not sure if it is supposed to do that or this is a bug.
i came across a bug (im not sure if its a bug or if its supposed to do it) while changing the color of my sprite. i wanted to see what would happen if i did the script that is down below. then it turned my sprite entirely black and white! im not sure if it is supposed to do that or this is a bug.
set [color v] effect to ((1) / (0))
Last edited by MultiGrainOats (Feb. 21, 2021 21:41:02)
- Seth_Zaw
- Scratcher
100+ posts
colorless sprites
Division by 0 is undefined, so that's probably the case.
¡Aprendamos español con los Alfabetons!
In my new series, you will cover genders of nouns, important and useful phrases, conjugating verbs and adjectives, regular and irregular words, and more, in Spanish!
Click here to get started!
Visit the Official Alfabetons Website: https://alfabetons.com
- PkmnQ
- Scratcher
1000+ posts
colorless sprites
I think it doesn't know what to set the color to, so it just resorts to black.
This is an account that exists.
Here, have a useful link:
The Official List of Rejected Suggestions by Za-Chary
- Fryman2599
- Scratcher
100+ posts
colorless sprites
click on 1/0 it says infinity My browser / operating system: ChromeOS 13421.102.0, Chrome 86.0.4240.199, No Flash version detected
i came across a bug (im not sure if its a bug or if its supposed to do it) while changing the color of my sprite. i wanted to see what would happen if i did the script that is down below. then it turned my sprite entirely black and white! im not sure if it is supposed to do that or this is a bug.set [color v] effect to ((1) / (0))
- Flowermanvista
- Scratcher
1000+ posts
colorless sprites
Before I have to say what I want to say, I have to explain what a floating point number is, just to make sure that we're all on the same page:
In computing, a floating-point number is a type of number that can store a relatively large range of numbers, with a non-fixed number of digits past the decimal point, all in a much smaller space than would normally be required for such versatility - with the caveat that accuracy is limited to a certain number of decimal digits.
JavaScript, the language in which Scratch is written, uses a double-precision floating-point number (also known as a “double float” or just “double”) as its primary type of number (and for a long time, its only type of number). A double float can accurately represent around 15-17 decimal digits - anything more will be rounded to the nearest value that a double float is capable of representing.
With all that said, what I wanted to address:
Something else I wanted to note is that if you write “Infinity” and paste it into the “set color effect to” block (you must capitalize the first letter, otherwise it will be treated as the string “infinity” rather than the number Infinity, in which case nothing will happen), it will also produce the desaturated effect.
In computing, a floating-point number is a type of number that can store a relatively large range of numbers, with a non-fixed number of digits past the decimal point, all in a much smaller space than would normally be required for such versatility - with the caveat that accuracy is limited to a certain number of decimal digits.
JavaScript, the language in which Scratch is written, uses a double-precision floating-point number (also known as a “double float” or just “double”) as its primary type of number (and for a long time, its only type of number). A double float can accurately represent around 15-17 decimal digits - anything more will be rounded to the nearest value that a double float is capable of representing.
With all that said, what I wanted to address:
Although this is correct in a mathematical sense, the Division by 0 is undefined, so that's probably the case.IEEE 754 Standard for Floating-Point Arithmetic, the standard on which almost all implementations of floating-point numbers are based on (JavaScript's included), stipulates that dividing a floating-point number by 0 equals Infinity. This is why 1/0 is Infinity, even if it's technically mathematically incorrect.
Something else I wanted to note is that if you write “Infinity” and paste it into the “set color effect to” block (you must capitalize the first letter, otherwise it will be treated as the string “infinity” rather than the number Infinity, in which case nothing will happen), it will also produce the desaturated effect.
Last edited by Flowermanvista (March 2, 2021 20:23:30)
Add a SPOOKY SKELETON to your project!
The Scratch 3 Project Save Troubleshooter - find out why your project won't save
ST, Please Add A Warning When A Size Limit Is Exceeded
My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
- MultiGrainOats
- Scratcher
20 posts
colorless sprites
im just gonna pretend i understand what you just said
when I receive [what u just said v]
say [mhm got it 0_0] for (2) secs
- GamerMarcus646
- Scratcher
100+ posts
colorless sprites
This happens because 1 divided by 0 is Infinity, therefore Scratch tries to set a number value to letters. Think of it like cloud variables, you can only set them to numbers. However, if you try to set the cloud variable to letters, it fails. My browser / operating system: ChromeOS 13421.102.0, Chrome 86.0.4240.199, No Flash version detected
i came across a bug (im not sure if its a bug or if its supposed to do it) while changing the color of my sprite. i wanted to see what would happen if i did the script that is down below. then it turned my sprite entirely black and white! im not sure if it is supposed to do that or this is a bug.set [color v] effect to ((1) / (0))
set [☁ score v] to ((1) / (0))This ^ is the same as this v
set [☁ score v] to [Infinity]
Come on Scratch Cat, you can do it! Pave the way, put your back into it! Tell us why, show us how, look at where you came from, look at you now! teenagers, kids and adults, beginners! Can learn to code it, let them code, share it out, come on Scratch Cat, Teach ‘em!
- Flowermanvista
- Scratcher
1000+ posts
colorless sprites
Actually, this isn't quite true. “Infinity” (with a capital I, see my previous post in this topic) actually is a number - and being able to set a cloud variable (which only supports numbers) to Infinity is proof of that. This happens because 1 divided by 0 is Infinity, therefore Scratch tries to set a number value to letters. Think of it like cloud variables, you can only set them to numbers. However, if you try to set the cloud variable to letters, it fails.set [☁ score v] to ((1) / (0))This ^ is the same as this vset [☁ score v] to [Infinity]
Add a SPOOKY SKELETON to your project!
The Scratch 3 Project Save Troubleshooter - find out why your project won't save
ST, Please Add A Warning When A Size Limit Is Exceeded
My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
- Discussion Forums
- » Bugs and Glitches
- » colorless sprites