On the Subject of Markscript

Turing complete on the inside, wacky stripes on the outside.

This module is a computer, which itself consists of a screen, a red power button, and a keyboard. There will be a programming task for you to implement. To disarm the module, write and execute a program that completes the task. This module does not strike.

Use the key to switch between coding mode and task mode. Task mode displays a description of the program you must write.

Pressing the power button while in coding mode executes the program. Pressing it again while the program is being executed aborts it.

Almost all keyboard keys, including the one shaped like a Tetris Z, will simply append the character shown on the key to the current line. The exceptions are listed below.

  • : Switches modes. All other controls don’t work while in task mode.
  • : Removes the last character from the current line. Note that this does not work if the character you are attempting to remove is a ?.
  • , : Moves the cursor to the previous or next line, respectively.

Your physical keyboard can also be used to type. Letters, space, backspace, and arrow keys work as expected. Enter and numbers work normally so long as Shift is not held. The table below shows what physical keys are changed to when Shift is held. Keep NumLock in mind when using the physical keyboard.

12345678Enter
«

The program will be written in a programming language called, unsurprisingly, Markscript, the complete documentation of which is provided below. All variables presented in the task will be automatically given values before the program is run. The module will disarm when the correct output is returned five times in a row. If an incorrect output is returned or the module attempts to execute a line with a syntax error, the screen will display the problem and the program will halt. Press to return to coding mode while in this state.

Programs in this language will for the most part run each line, in order, from top to bottom. Unless stated otherwise below, after a line is run, the line below it will run after.

Comments are used to help the programmer mark what sections of code do, and are mostly ignored when the program is run. Comments can be added to the end of any line so long as you put a « first. Comments cannot include spaces nor numbers and it’s recommended that the same comment isn’t used more than once. Only one comment is allowed per line.

Syntax: [code] «[comment]
Examples: ♫0 «DONE, ₪STUCK «STUCK, ☼X 21 «MEME, STUFF√ 47 «ETC

Variables are used to store numerical data within the program which can be used in the future. Variables are declared by starting a line with a , followed by a variable name, then a space, then a numerical value or the name of an already-declared variable. Attempting to declare a new variable with an already-existing name will cause an error. In order to assign a value to an already-declared variable, place the after the variable name instead. You can assign a negative number by using as a negative sign. Note that you cannot do so for variable names.

Syntax: √[name] [value]
Examples: √SIX 7, SIX√ 6 «WHOOPS, √COPY ORIG, √NEGATIVEONE ♣1

If-statements are used to check a condition. If-statements can be created by starting a line with , followed by a variable name, then a space, then one of the comparison operators shown below, then the value to compare against. Operators are: = less than, ∩∩ = equal to, and ♣∩ = greater than. If the condition is true, the next line of code is skipped.

Syntax: ◊[name] [condition][value]
Examples: ◊NUM ∩∩0, ◊HMMM ∩♣10, ◊BIGONE ♣∩MILLION, ◊ANSWER ∩42

Jumps are used to move to different parts of the program. To write a jump, start the line with a , followed by the comment in the line you wish to jump to. If multiple lines have the same comment, the topmost is used.

Syntax: ₪[comment]
Examples: ₪TOP, ₪BACK, ₪THATLINE, ₪THINGONE «THINGTWO

Addition is the only arithmetic operation possible directly in this language. To write one, start the line with a , followed by the variable name, then a space, then the value to be added. The result of the addition is assigned to the same variable.

Syntax: ☼[name] [value]
Examples: ☼SMALL 100, ☼OFCOURSE THISWORKS, ☼DIM DIM, ☼HINT ♣1

Return statements are used to exit the program with a specific output value. To return, start the line with a , followed by the output value. An incorrect value being returned will result in an error.

Syntax: ♫[value]
Examples: ♫0, ♫YESVARIABLESWORK, ♫♣1, ♫1 «FINISHED