Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
computers.ni
"dungeon planet" by Joseph Parker
Book 1 - Rules
Chapter 1 - Computers
An operating system is a kind of value. The operating systems are linux.
A computer is a kind of device. Understand "computer" as computer.
A computer has a text called power_up_text.
The power_up_text of a computer is usually "[The noun] boots up and the screen flickers on.".
A computer has a text called power_down_text.
The power_down_text of a computer is usually "[The noun] shuts down.".
A Computer has an operating system.
Computers are usually linux.
A folder is a kind of container.
A folder has a text called name.
[Understand the name property as describing a folder.]
bin, home and etc are kinds of folders.
A drive is a kind of folder.
A drive is usually closed.
Every drive contains a bin, a home, and an etc.
A drive is part of every computer.
A computer has a folder called CWD.
After an actor switching on a computer (called C):
Let D be a random drive that is part of the C;
Say the power_up_text of C;
Now the D is open;
Say "[line break]".
After an actor switching off a computer (called C):
Let D be a random drive that is part of the C;
Say the power_down_text of C;
Now the D is closed;
Say "[line break]".
When play begins:
repeat with the comp running through computers:
Let D be a random drive that is part of the comp;
Say "[comp] [D]";
Now the printed name of D is "";
Now the CWD of comp is D;
Every turn:
If the player has a computer (called C) and C is switched on:
Now the command prompt is "[bold type][The actor]@[C]:[CWD of C]/>[roman type]";
Else:
Now the command prompt is ">".
Chapter 2 - software
Section 1 - definition
A software is a kind of thing.
A software has a text called usage. The usage of a software is usually "no use.".
A software has a text called version. The version of a software is usually "0.0.1".
A software has a text called manpage. The manpage of a software is usually "".
undefined is a backdrop. undefined is everywhere.
parent_directory is a folder.
Section 2 - behavior
A thing can be digital. software is digital. folders are digital.
Instead of doing something to a digital thing:
Say "You can't do physical things with software.."
To decide which thing is the computer of the (P - a person):
If P has a computer (called C) and C is switched on:
decide on C;
Else:
decide on undefined.
invoking it with is an action applying to two things.
Understand "[software] [anything]" as invoking it with.
Understand "type [software] [anything]" as invoking it with.
Understand "type [software]" as invoking it with.
Understand "[software]" as invoking it with.
Rule for supplying a missing second noun while invoking a software with nothing (this is the dault arg rule):
now the second noun is undefined.
consulting is an action applying to one thing and one topic.
Understand "[software] [text]" as consulting.
Before invoking something with anything:
If the computer of the actor is undefined:
Say "You would need a working computer to do that." instead.
Instead of invoking something (called S) with anything:
Say "USAGE: [usage of S]".
Section 2 - packages
a ls is a kind of software.
It has a version "300.1.9".
It has a usage "ls".
It has a manpage "ls will list the contents of the current working directory".
Instead of an actor invoking ls with undefined:
let cwd be the CWD of the computer of the actor;
let files be the list of things contained by cwd;
Repeat with item running through files:
If the item is a folder, say "[bold type]";
otherwise say "[roman type]";
say "[item] ";
Say "[roman type][line break]".
a cd is a kind of software.
It has a version "12.2.1".
It has a usage "cd -directory".
It has a manpage "cd will change the current working directory to the provided arg".
Instead of an actor invoking cd with a folder:
let cwd be the CWD of the computer of the actor;
let target be the second noun;
if the target is a folder and the target is in cwd:
now the CWD of the computer of the actor is the target;
say "[line break]".
a manual is a kind of software.
It has a version "5239.01.47".
It has a usage "manual -package".
It has a manpage "Manual, the standard manpage reader for the modern computer. If you are reading this, it is properly working!".
Instead of invoking manual with a software (called S):
Say "[second noun] version [version of S][line break]USAGE: [usage of S][line break][manpage of S][line break]".
[STANDARD PACKAGE INSTALLATION]
Every bin contains a ls, a cd, and a manual.
[
galactopedia is a software.
It has a version "0.2.1".
It has a usage "galactopedia -keyword".
It has a manpage "Galactopedia is a search engine for the galactic knowledge base. Knowledge files (.kno) are stored in ~/.galactopedia/".
Instead of calling galactopedia:
repeat through table of search results:
If topic entry is "sword":
Say "[data entry]".
]
Book 3 - NPC's
Chapter I - Party Commands
Persuasion rule for asking a person (called P) to try doing something:
let request be the current action;
say "'[action name part of request] [The noun], sir!'";
persuasion succeeds.
Unsuccessful attempt by someone (called A) trying doing something:
say "=>[reason the action failed]";
Understand "give [thing] to [person]" as giving it to.
Instead of an actor giving something(called T) to a person(called P):
Say "[P] takes the [T] from [actor]";
Now the P has the T;
rule succeeds.
Book 4 - Data
Table of search results
topic category data
"dungeon planet" "history" "Dungeon Planet is a fabricated planetoid in the E-Y7483 system. Although the true origins of the dungeon planet are lost to history, it has become one of the most famous locals in the galaxy."
"sword" "weaponry" "Swords are long, sharp objects used in ceremonial body combat by many species"
"lead" "materials" "Lead is the heaviest metal, it's malleable nature gives it use in situates where raw weight is desired"
"WINDOWS" "software" "Weaponized Interface Notation Deployed on Warring Starships (WINDOWS) is a human operating system used to control military hardware. All reviews are positive, as mandated by the Hegemony."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.