https://github.com/smjsgaming/spwn-binary-calculator
As a part of the beta testing team I decided to make my first SPWN project a binary calculator library.
https://github.com/smjsgaming/spwn-binary-calculator
Last synced: 5 months ago
JSON representation
As a part of the beta testing team I decided to make my first SPWN project a binary calculator library.
- Host: GitHub
- URL: https://github.com/smjsgaming/spwn-binary-calculator
- Owner: SMJSGaming
- Created: 2020-12-24T17:39:40.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-25T09:23:23.000Z (over 5 years ago)
- Last Synced: 2025-07-17T20:51:12.454Z (11 months ago)
- Size: 1.95 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SPWN Beta Test
As a part of the beta testing team I decided to make my first SPWN project a binary calculator library.
## Usage
see [the runner](/runner.spwn).
## Functions from @binaryCalculator
A list of all functions and how to use them.
### ::new
The class constructor.
```swift
@binaryCalculator::new(bits: @number, x: @number, y: @number);
```
- bits: The amount of bits in the binary number
- x: The base X position of the bits
- y: The Y position of the bits
### binaryToDecimal
A conversion method to turn the bits into a decimal number which is stored in the target.
```swift
binaryCalculator.binaryToDecimal(target: @counter);
```
- target: The target counter storage
### decimalToBinary
A conversion method to convert the source into binary which is stored in the provided bits.
```swift
binaryCalculator.decimalToBinary(source: @counter, calcSpeed: @number = 5);
```
- source: The counter source
- calcSpeed: The speed at which it divides. Higher speed is more trigger heavy
### prettyDecimalToBinary
A slower but more interesting and clear version of [decimalToBinary](#decimalToBinary) showing how the number iterates through its division cycles. This uses less logic so it can handle larger numbers without exceeding the group limit.
```swift
binaryCalculator.prettyDecimalToBinary(source: @counter, calcSpeed: @number = 10);
```
- source: The counter source
- calcSpeed: The speed at which it divides. Higher speed is more trigger heavy