MJr-compiler
MJr is a probabilistic programming language based on pattern-rewriting, heavily inspired by MarkovJunior by Maxim Gumin. This project provides a compiler for the MJr programming language, which compiles MJr programs to JavaScript, TypeScript or Python 3.
Examples
- Basic.mjr: the simplest MJr program that does anything. Hello, World!
- Backtracker.mjr: generates connected cave systems with pools, using only two rewrite rules.
- BacktrackerCycle.mjr: generates a random cycle.
- River.mjr: generates a river with grass growing around it.
- GameOfLife.mjr: John Conway's "Game of Life".
- BasicSnake.mjr: plays a classic game of Snake, albeit not very well.
- PacMan.mjr: another classic game.
- BasicDungeonGrowth.mjr: builds a connected dungeon with rooms and corridors.
- NystromDungeon.mjr: builds a connected dungeon using Bob Nystrom's algorithm.
- MazesAndLakes.mjr: generates a weird landscape of cities, forests and lakes.
Documentation
See the documentation and implementation notes for more information.