esolang

Cheesecake

Twelve stack commands, every one of them spelled with the words cheese and cake.

Nebular · Turing complete: unknown · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: 42

The idea

Nebular made Cheesecake in a few hours. It is a small stack machine where each command is a short run of the words cheese and cake, and the word cheesecake sits between a command and its argument. Numbers are spelled too. A number is the word cake with one e more than its value, so cake is 0, cakee is 1 and printing an H needs a cake with 73 of them, unless you multiply.

The machine

One instruction per line.

WordsDoes
cheese cheesecake nPush n
cake cheese cake cake cheeseDiscard, duplicate, swap
cheese cheese cake cakeAdd, subtract
cheese cheese cheese cheese cheese cakeMultiply, divide
cheese cake cake cheesecake nJump to line n if the top is 0
cake cake cake cheese cheese cheese cheesePrint the top as a character or as a number
cheese cheese cheese cakeRead a character

The specification leaves the details to its programs. Its Hello world only prints text if printing a character pops it and subtraction takes the top from the one below it. Its truth machine only works if the jump leaves the top where it is. Lines count from 1, which makes every line of the truth machine do work.

Example

Six times seven.

Six times seven.

The truth machine reads a character and takes 48 from it. On 0 the jump goes to line 10, which pushes a 0 to print. On 1 it loops over lines 5 to 9 and prints 1 forever.

Expected: 0

The Hello world is 56 lines. It builds each letter from small numbers, keeps a copy with cheese cake to make the next one, and prints Hello, world!.

Patterns it teaches

Further

Pseudonatural

Stack-based

Write your own in Run Convert a program from Cheesecake

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: cheesecake.

Command line

shib run cheesecake program.txt --input '0'

The program is long; save it as program.txt first.

shib manual cheesecake

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/cheesecake.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org