From 0223250c88712915cf9e843613671f768fda01fe Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Mon, 14 Apr 2025 19:40:01 +0200 Subject: [PATCH] add brainfuck and deadfish levels --- CHANGELOG.md | 3 ++- README.md | 4 +--- levels/chapter_05.json | 44 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 levels/chapter_05.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b00185..6dbdfd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ Game store page: https://crispypin.itch.io/marble-machinations ## [unreleased] ### added -- create "missing levels" section allowing access to solutions to levels that are no longer available +- "weird machines" chapter with levels for [deadfish](https://esolangs.org/wiki/Deadfish) and [brainfuck](https://esolangs.org/wiki/Brainfuck) +- "missing levels" section giving access to solutions to levels that are no longer available - click to collapse chapters in level list - input bindings for eraser (X), selection (B), blueprint list (Ctrl B), no tool (no default binding) ### fixed diff --git a/README.md b/README.md index b24b022..4808bb9 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,8 @@ logic mostly like https://git.crispypin.cc/CrispyPin/marble ### features #### 0.3.x - more levels - - deadfish - - brainfuck - packet routing? - - game of life sim? (width;height;steps;grid -> grid) + - game of life sim (width;height;steps;grid -> grid) #### 0.4.0 - UI layout engine - global scale setting diff --git a/levels/chapter_05.json b/levels/chapter_05.json new file mode 100644 index 0000000..e08eeb8 --- /dev/null +++ b/levels/chapter_05.json @@ -0,0 +1,44 @@ +{ + "title": "5. Weird machines", + "levels": [ + { + "id": "deadfish", + "name": "Deadfish", + "description": "Deadfish is a very small joke programming language. It is often used as a test program for other esoteric programming languages. Marble machinations is now one of them.\n\n There are four commands:\ni: increment the accumulator\nd: decrement the accumulator\ns: square the accumulator\no: output the accumulator\n\n if the value becomes -1 or 256, it should be set to zero.\n\nThe test cases are taken from esolangs.org/wiki/Deadfish", + "stages": [{ + "input": "iiso", + "output": "4" + },{ + "input": "iissso", + "output": "0" + },{ + "input": "diissisdo", + "output": "288" + },{ + "input": "iissisdddddddddddddddddddddddddddddddddo", + "output": "0" + }] + }, + { + "id": "brainfuck", + "name": "Brainfuck", + "description": "The language brainfuck operates on a 'tape' of bytes, with a pointer that can be moved left and right. Level input is formatted as '#'.\n(separator # is 35)\n\n+ (43): increment\n- (45): decrement\n< (60): move left\n> (62): move right\n, (44): input\n. (46): output\n[ (91): skip to matching ] if current value is zero\n] (93): jump to matching [ if current value is not zero\n\nmaximum memory needed: 32 bytes\nlongest program: 106 commands", + "stages":[{ + "input": ">><[]++++++++-.#", + "output": [7] + },{ + "input": ",>,>,>,.<.<.<.#woem", + "output": "meow" + },{ + "input": "++++[++++.]#", + "output": [8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 0] + },{ + "input": "-[>,]<+[-.<+]-#reverse cat program", + "output": "margorp tac esrever" + },{ + "input": "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.#", + "output": "Hello World!\n" + }] + } + ] +} \ No newline at end of file