Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Jan 1, 2025
1 parent b0a51f3 commit 9078d50
Showing 1 changed file with 63 additions and 6 deletions.
69 changes: 63 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,71 @@ The creative language for ASCII art based on Basic.
## Get Started

```bash
$ cell hello.bas
$ cell fire.cll
```

```basic
DO
POINT mouseX, mouseY
PAUSE 10
LOOP
```
SET fire []
SET $frameRate 15
FOR i 0 $width:
FOR j 0 $height:
SET fire[i][j] 0
END
END
LOOP:
UPDATE_FIRE
DRAW_FIRE
RETURN
UPDATE_FIRE:
Len h fire
Len w fire[0]
SET max h
FOR y 0 (h - 1):
FOR x 0 w:
RANDOM_INT decay 0 3
RANDOM_INT spread -1 1
LIMIT index x - spread 0 w - 1
SET target fire[y + 1][index]
END
END
FOR x 0 w:
NOISE t (x / 10) 0 max
FLOOR t
SET fire[h - 1][x] t
END
RETURN
DRAW_FIRE:
Len h fire
Len w fire[0]
SET max h
CLEAR 0
FOR y 0 h:
FOR x 0 w:
SET d fire[h][w]
IF d == 0:
SET $strokeCh " "
SET $strokeBg NULL
ELSE:
RANDOM_CHAR $strokeCh
MAP $strokeBg 0 max 0 1
INTERPOLATE_COOL $strokeBg $strokeBg
END
POINT y x
END
END
RETURN
```

## License 📄
Expand Down

0 comments on commit 9078d50

Please sign in to comment.