https://github.com/riptl/pixelstrom
Pixelflut for Solana
https://github.com/riptl/pixelstrom
Last synced: 9 months ago
JSON representation
Pixelflut for Solana
- Host: GitHub
- URL: https://github.com/riptl/pixelstrom
- Owner: riptl
- Created: 2022-02-13T11:59:01.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-13T19:35:06.000Z (about 4 years ago)
- Last Synced: 2025-06-08T00:08:19.115Z (10 months ago)
- Language: C
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pixelflut for Solana
## Rules
- Free-for-all
- Canvas consisting of 32x32 chunk (3072 bytes)
- RGB bitmap
- Each transaction sets one pixel
## Program
The `pixelstrom` program maintains the virtual canvas.
### Instruction: SetPixel
Sets a single pixel in the canvas.
Will only execute when it is the only instruction in a transaction.
Account inputs:
1. Chunk account (writable)
2. Instructions sysvar
Instruction data (big-endian)
1. `x: i32`
2. `y: i32`
3. `r: u8`
4. `g: u8`
5. `b: u8`
### Account: Chunk
Chunk accounts are PDAs.
The PDA seeds list looks like this:
- ASCII string `Chunk`
- Big-endian i32 chunk coordinates (y, x).
```python
def chunk_seed(y, x):
return [b'Chunk', struct.pack(">i", y), struct.pack(">i", x)]
```
```
>>> list([b.hex() for b in chunk_seed(-4, 3)])
['4368756e6b', 'fffffffc', '00000003']
```