Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
909a2ac
Created bitsandhexa.js to update later and start developing this
BurningHot687 Jul 26, 2025
a9e33d1
Added fix for hexadecimal conversion
BurningHot687 Jul 27, 2025
0add430
Fixed bugs with hexa and added shifters
BurningHot687 Jul 28, 2025
4564553
Finished all currently planned block additions
BurningHot687 Jul 28, 2025
85a48cf
Everything Broke With Negatives (but new blocks!)
BurningHot687 Jul 28, 2025
126fbff
Merging broken code because it's otherwise finished lol
BurningHot687 Jul 28, 2025
f0adfec
Added the extension here
BurningHot687 Jul 28, 2025
d4fface
Merge pull request #2 from BurningHot687/patch-1
BurningHot687 Jul 28, 2025
03d36e2
Created documentation that isn't complete
BurningHot687 Jul 28, 2025
3cee7eb
Added documentation to extension list
BurningHot687 Jul 28, 2025
0e44341
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 2, 2025
93c12c1
Added extension to documentation here as well
BurningHot687 Aug 2, 2025
b26732c
Fixed positive number bugs for conversion
BurningHot687 Aug 2, 2025
297deea
Adding Banner Soon
BurningHot687 Aug 2, 2025
1527c77
Added banner
BurningHot687 Aug 2, 2025
0d24331
Delete static/images/BurningHot687/placeholder-thing.png
BurningHot687 Aug 2, 2025
7ceee08
Added more ways to handle bits (not implemented)
BurningHot687 Aug 3, 2025
16fb7a5
New doc update + ideas
BurningHot687 Aug 3, 2025
9ff0429
whoops
BurningHot687 Aug 3, 2025
1dfb62f
Add files via upload
BurningHot687 Aug 5, 2025
4a9e6fe
Everything Except Lengths Done
BurningHot687 Aug 5, 2025
ff5b620
Better documentation?
BurningHot687 Aug 5, 2025
d35233f
whoops 2: electric bungaloo
BurningHot687 Aug 5, 2025
3d51221
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 6, 2025
9ec6113
Decimal to Binary with Dynamic Length works?
BurningHot687 Aug 6, 2025
2b4ab68
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 6, 2025
48e45e9
@SCsupercraft the goat
BurningHot687 Aug 6, 2025
62c3af5
Still some problems but working on it!
BurningHot687 Aug 6, 2025
40d4638
Cleaning up opcodes + bug fix?
BurningHot687 Aug 7, 2025
df1c753
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 7, 2025
9434745
Updated banner
BurningHot687 Aug 7, 2025
5181b56
Finished rename + basic testing of bugfix
BurningHot687 Aug 7, 2025
af866a1
halfway baked
BurningHot687 Aug 7, 2025
de0e497
Update extensions.js
BurningHot687 Aug 7, 2025
a912b46
Arrays + hopefully fixed dynamic length
BurningHot687 Aug 7, 2025
f15fd6c
Array fix
BurningHot687 Aug 7, 2025
af5411e
I hate dynamic length
BurningHot687 Aug 7, 2025
bb4cf4d
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 8, 2025
ff95d7e
String Update + Dynamic Length Probably Dropped
BurningHot687 Aug 8, 2025
bae2a6f
Strings probably finished, very close to finishing
BurningHot687 Aug 8, 2025
dda185c
Can someone do this for me
BurningHot687 Aug 8, 2025
201ad12
Idek anymore
BurningHot687 Aug 10, 2025
a955495
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 12, 2025
f4c40b3
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 12, 2025
a708fb7
UH DIDNT TEST GOTTA RUN
BurningHot687 Aug 12, 2025
0be3a03
Added utilities + fixed arrays and endianness
BurningHot687 Aug 14, 2025
3d0f269
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 14, 2025
9058b54
Added some shifts to docs
BurningHot687 Aug 14, 2025
6af3eb2
Updated version number
BurningHot687 Aug 14, 2025
18e87a2
More docs
BurningHot687 Aug 14, 2025
a38f03a
Cleanup
BurningHot687 Aug 14, 2025
39abd22
All main blocks to docs
BurningHot687 Aug 14, 2025
a5dc926
Setup extras, will add soon
BurningHot687 Aug 14, 2025
098c858
Fixed typoe ]
BurningHot687 Aug 14, 2025
ea70425
Hopefully finished docs with minimal problems
BurningHot687 Aug 14, 2025
85f0929
UTF-16 vs Unicode
BurningHot687 Aug 14, 2025
73bc7d4
Fixed weird formatting hopefully
BurningHot687 Aug 16, 2025
2de898c
More Cleanup
BurningHot687 Aug 16, 2025
5b23ff4
20 FOLD DIFFERENCE?!
BurningHot687 Aug 20, 2025
c556aa7
Guess Who Just Remembered This Existed?
BurningHot687 Aug 20, 2025
f56c6d3
Deleted PNG
BurningHot687 Aug 20, 2025
c584d62
Condensed and fixed array to string bug
BurningHot687 Aug 20, 2025
813aaaa
Documentation button opens new tab
BurningHot687 Aug 20, 2025
0c45434
Octals + Single-Precision Floats Added
BurningHot687 Aug 24, 2025
74eb25d
version 1.3
BurningHot687 Aug 24, 2025
61b79e1
Merge branch 'PenguinMod:main' into main
BurningHot687 Aug 24, 2025
5bbb631
Added Constants + Turbowarp Compatibility
BurningHot687 Aug 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions src/lib/Documentation/bitsandhexa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Bitwise+ v1.3
## Bitwise Operations for Decimals, Binary, and Hexadecimal
### By BurningHot687/Raichu-Model/-Rig

If you are unfamiliar with bitwise operations, then hopefully this documentation can help you. If you still need further reading, you may go to this [Wikipedia Article](https://en.wikipedia.org/wiki/Bitwise_operation). I do not claim to be an expert, so these explanations might not be the best unless you've got the context for them.

###### Keep in mind that version 1.3 currently only supports binary, decimal, hexadecimal, and octals. All outputs, unless specified otherwise, are going to be in decimal. All inputs, unless specified otherwise, are assumed decimal unless there is a hexadecimal character within it. Also keep in mind Scratch has a 32 bit system.

---
```scratch
<is [1011] [decimal v]?::#15448f
```
Checks if the provided string is one of the alloted bases.
```scratch
(convert [4d2] from [hexadecimal v] to [decimal v]::#15448f
```
If the input and its assigned base are the same, then it will convert to the requested base.
```scratch
(get bit at index (3) of [13]::#15448f
```
Gets the bit (`0` or `1`) at the index of the binary representation of the input number. Index `0` refers to the least significant bit.

---
```scratch
([-13] >> (3)::#15448f
```
Signed right shift. Think of it like this:
We have a number -13 in binary:
`11111111111111111111111111110011`
The sign bit at the very left is `1`, and let's say we shift it 3 places to the right without accounting for the sign.
`00011111111111111111111111111110`
That's a completely different number! (`536870899`)
For this reason, for each shift, we "duplicate" the sign bit and move it over to the left. After three shifts we end up with `-2`.
`11111111111111111111111111111110`
Obviously positive numbers wouldn't be affected drastically due to their sign bits being `0`.
```scratch
([13] \<\< (3)::#15448f
```
Shifts the bits left by the amount requested (`1111` to `111100` if the amount was `2`).
```scratch
([-13] >>> (3)::#15448f
```
Unsigned right shift. Just shifts it to the right without caring about the sign bit:
`11111111111111111111111111110011` to `00011111111111111111111111111110` or `-13` to `536870899`
```scratch
([-13] ↻ (3)::#15448f
```
Circular right shift:
Basically an unsigned right shift but instead of deleting bits they are looped to the 32nd bit.
```scratch
([-13] ↺ (3)::#15448f
```
Same as before but opposite direction.

---
```scratch
(() & () | and::#15448f
```
Bitwise and.

```scratch
(() | () | or::#15448f
```

Bitwise or.

```scratch
(() ^ () | xor::#15448f
```

Bitwise exclusive or (returns `1` if both bits are different).

```scratch
(~() | not::#15448f
```

Bitwise not.

```scratch
(~() & () | nand::#15448f
```

Bitwise nand (`0` if both inputs are on).

```scratch
(~() | () | nor::#15448f
```

Bitwise nor (`1` if both inputs are off).

```scratch
(~() ^ () | xnor::#15448f
```

Bitwise exclusive nor (`1` if both inputs are the same).

## Extras

These blocks are more experimental and definitely require updates here and there. These are meant to be used for specific-use cases.

---

```scratch
(character (0) of [f] to [UTF-16 v] in [decimal v]::#15448f
```

Takes in a string and applies
```javascript
"string".charCodeAt(number);
```

`codePointAt` is used for Unicode.

```scratch
(number (41) using [UTF-16 v] in [decimal v] to character::#15448f
```

Takes in a number and applies
```javascript
String.fromCharCode(number);
```

`fromCodePoint` is used for Unicode.

```scratch
(::ring)[foo?!] to [UTF-16 v] array in [decimal v](::ring)::ring control :: #15448f
```

Takes in an array and turns it into a string.

```scratch
([UTF-16 v] array ((::ring)(::ring):: ring control :: #0a094f) in [decimal v] to string::#15448f
```

Takes in an array and returns a string.

---

```scratch
(0x ()::#15448f
```

Takes in a hexadecimal number and returns a decimal.

```scratch
(0b ()::#15448f
```

Takes in a binary number and returns a decimal.

```scratch
(0o ()::#15448f
```

Takes in an octal number and returns a decimal.

```scratch
(convert float 32 (6.28) to [binary v]::#15448f
```

Takes in a single-precision float (32 bits) and turns it into the requested base.

```scratch
(convert [f00] in [hexadecimal v] to float 32::#15448f
```
Takes in a number, reads it in the assigned base, and converts it into a float32. Because of the way floats are stored, using the above block as the number input in this block would most likely result in a different number being outputted, with a few exceptions.

```scratch
(reverse endianness of (37) in [decimal v]::#15448f
```

Switches the byte order of the provided number.

---

These blocks probably won't work with extra blocks and *might* break normal blocks (or at least show unexpected behavior).

```scratch
use a [static v] length for binary::#15448f
```

Changes the representation of binary numbers. Two's complement is applied to the most significant bit provided rather than the 32nd bit in dynamic mode.

```scratch
<using [static v] length?::#15448f
```

Checks if you're using static or dynamic length.

---

And that should be all! :D
5 changes: 5 additions & 0 deletions src/lib/Documentation/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import PaintUtils from "./PaintUtils.md?raw";
// Resolution
import Resolution from "./Resolution.md?raw";

import PageBitsAndHexaDocs from "./bitsandhexa.md?raw";

export default {
// the key is the path to the docs page
// so you can do "sharkpool-particle-tools" for example
Expand Down Expand Up @@ -65,4 +67,7 @@ export default {

// Resolution
"Resolution": Resolution,

// Bitwise with Hexadecimal
"bitsandhexa": PageBitsAndHexaDocs,
};
11 changes: 11 additions & 0 deletions src/lib/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,17 @@ export default [
creatorAlias: "gaimerI17",
note: "Extension thumbnail made by Dillon."
},
{
name: "Bitwise+",
description: "An expansion of the original Bitwise extension, this adds a lot of binary representation abilities!",
code: "BurningHot687/bitsandhexa.js",
banner: "BurningHot687/bitsandhexa.avif",
creator: "Raichu-Model",
documentation: "bitsandhexa",
creatorAlias: "BurningHot687/Raichu-Model/-Rig",
notes: "An expansion of a turbowarp extension",
isGitHub: false,
},
/* these extensions are completely dead as of now
{
name: "Online Captcha",
Expand Down
Loading