Show HN: Code garden deep-dive: my Forth C64 tetromino game
github.com(The article is permalinked to a tag, for latest:)
Deep-dive: https://github.com/ekipan/sss/blob/main/Design.md
Repo front page: https://github.com/ekipan/sss
The Silent Soviet Stacker is, in order:
1. A tinker-toybox I wrote and pick at to relax.
2. A technical deep-dive writeup, showing Forth by example.
3. A game that works and you can play.
Try it (<5 minutes): 1. C64 emulator [1]
2. Load durexforth cart [2]
3. Copy [3] contents to clipboard
4. Edit > Paste in VICE.
5. Type `help` then `new`.
[1]: https://vice-emu.sourceforge.io/[2]: https://github.com/jkotlinski/durexforth/releases
[3]: https://github.com/ekipan/sss/blob/share-hn/sss.fs
$ wc README.md Design.md Tinkering.md
90 445 2928 README.md
823 4863 27985 Design.md
182 1029 6512 Tinkering.md
1095 6337 37425 total
$ wc sss.fs # docs-to-code ratio >4:1!
284 1997 8680 sss.fs Doc excerpts, as a teaser:
- SDF JKL layout keeps me on home row, ready to type Forth.
- 39 columns source text to fit the C64 screen.
- `0 prof` patches the first instruction to an `rts`,
disabling the profiler. `1 prof` restores the `eor`.
- The `dup 0= +` phrase ensures nonzero seed, harmless but
it's cute and I've grown fond of it.
- Might be able to spread `land` work across frames but the
complexity isn't worth it.
- I choose the extra `rdrop` cognitive load just for its
aesthetic.
- <!-- It's better left unsaid. -->
I would be tickled if this was the thing to bring
at least a few people from vaguely Forth-curious to
writing something substantial. Tell me what delights or
confuses you. What could be better, what needs examples.