No history found.
README.md:
Ternary logic
Compute "ternary logic" using an 8-entry lookup table.
For each bit, the expression will be computed as: | a
|
b
| c
| lut
| | — | — | — |
——————— | | 0
| 0
| 0
|
lut & (1 << 0) != 0
| |
0
| 0
| 1
|
lut & (1 << 1) != 0
| |
0
| 1
| 0
|
lut & (1 << 2) != 0
| |
0
| 1
| 1
|
lut & (1 << 3) != 0
| |
1
| 0
| 0
|
lut & (1 << 4) != 0
| |
1
| 0
| 1
|
lut & (1 << 5) != 0
| |
1
| 1
| 0
|
lut & (1 << 6) != 0
| |
1
| 1
| 1
|
lut & (1 << 7) != 0
|
Example
// if sprite_mask { background } else { sprite }
background.ternlog(sprite, sprite_mask, 0xe4)
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Demindiro/ternlog-rs
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Demindiro/ternlog-rs
Clone this repository using git:
git clone git://git.rocketgit.com/user/Demindiro/ternlog-rs
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main