Discuss Scratch
- Discussion Forums
- » Suggestions
- » Different Bases
- FireArrow879
-
Scratcher
65 posts
Different Bases
We should be able to use different bases for easier decoding/encoding, and easier color picking.
This is what the block would look like:
The benefits would be more convenient base conversion, easier hex codes, better cloud data, and cloud variables being able to have a bigger decimal value!
This is what the block would look like:
(convert () to base (16) with digits (0123456789ABCDEF))And the default for the base will be 10.
set [ v] to [] in base (16) with digits (0123456789ABCDEF)
The benefits would be more convenient base conversion, easier hex codes, better cloud data, and cloud variables being able to have a bigger decimal value!
Last edited by FireArrow879 (Sept. 16, 2021 06:21:20)
- BautistaConTodo
-
Scratcher
100+ posts
Different Bases
Technically scratch already haves Base 16.
when green flag clicked
set [my variable] to (join[0x] [ff])
Last edited by Paddle2See (Sept. 16, 2021 02:08:41)
- Steve0Greatness
-
Scratcher
1000+ posts
Different Bases
Technically scratch already haves Base 16.what?when green flag clicked
set [my variable] to (join[0x] [ff])
EDIT: close your tags.
Last edited by Steve0Greatness (Sept. 15, 2021 23:33:22)
- Quantum-Cat
-
Scratcher
1000+ posts
Different Bases
Yes, Scratch has support for converting binary, hexadecimal and octal to decimal.Technically scratch already haves Base 16.what?when green flag clicked
set [my variable] to (join[0x] [ff])
EDIT: close your tags.
((join [0x] [ffffff]) + ()) // hexadecimal --> decimal: 16777215
((join [0b] [11111111]) + ()) // binary --> decimal: 255
((join [0o] [12345]) + ()) // octal --> decimal: 5349
- mumu245
-
Scratcher
1000+ posts
Different Bases
I didn't knew that!Yes, Scratch has support for converting binary, hexadecimal and octal to decimal.Technically scratch already haves Base 16.what?when green flag clicked
set [my variable] to (join[0x] [ff])
EDIT: close your tags.((join [0x] [ffffff]) + ()) // hexadecimal --> decimal: 16777215
((join [0b] [11111111]) + ()) // binary --> decimal: 255
((join [0o] [12345]) + ()) // octal --> decimal: 5349
- Discussion Forums
- » Suggestions
-
» Different Bases