3 ms·
Using JS for this feels like cheating... I wonder if similar things would be possible with PostScript?
by nialv7 2y ago
Using JS for this feels like cheating... I wonder if similar things would be possible with PostScript?
- ptspts 2y agoFrom the computation point of view, it's possible. PostScript has integer arithmetic operations needed for x86 CPU emulation. It also has mutable byte strings, which are useful as emulated memory.
- anthk 2y agoPostScript it's Turing Complete. Get GhostScript, zmachine.ps and some game, such as calypso.z3. You can just ddg/google them freely.
- anthk 2y agoWith PostScript you have zmachine.ps which is a ZMachine (zork and friends) interpreter to play text adventure games. And OFC there's a chess engine in PS, a tic tac toe, and with patience you could even play NES games, but you might need to play with the stack a lot.
- bla3 2y agoIt's possible, but not in a PDF. PDFs support only a turing incomplete subset of PostScript, because PDF's designers thought that having a turing complete language in your document format would have performance implications. (Later, they changed their mind and added JavaScript support.)
- dtech 2y agoAt least PDFs are generally usable with JS disabled, and it's not available in popular variants like PDF/A and PDF/X