We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Cave

From Esolang
Jump to navigation Jump to search

Cave is a stack-based esoteric programming language created by User:Pineapple. Memory is managed via a stack where variables are named after ores, and their values represent the weight of that ore in pounds.

Overview

Programs simulate exploring a cave system. Values (ores) are pushed onto and popped off of a central stack.

All code must begin with Enter the cave and end with Leave the cave.

Commands

Command Description
Enter the cave Required header to start the program.
Leave the cave Required footer to end the program.
[amount] pounds of [ore] Creates a variable named after an ore with a given weight in pounds (e.g., 11 pounds of gold).
Create a [ore] deposite in the cave Pushes the specified ore variable onto the top of the stack.
Mine from cave Pops (removes) the value at the top of the stack.
Put [ore1] and [ore2] in a minecart and roll it into the cave Combines (adds) the values of two ores and pushes the resulting sum onto the top of the stack.
Get lost Randomizes the order of all items currently on the stack.
Map the cave Prints the ASCII character values of the items in the stack.

I/O

  • Output: Map the cave outputs the contents of the stack converted to their corresponding ASCII characters.

Example programs

Mining and mapping

This example defines gold and iron, combines them into the stack, and prints the result:

Enter the cave
11 pounds of gold
65 pounds of iron
Create a gold deposite in the cave
Put gold and iron in a minecart and roll it into the cave
Map the cave
Leave the cave

Computational class

To be determined.

External resources

  • No external resources yet.