esolang

Arithmetic

A program is a pile of maths exams, and each exam prints its score as a letter.

None1, 2023 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hi

The idea

None1 made Arithmetic in 2023 after school arithmetic tests. Every problem is an addition with multiple choice answers. A right answer earns the problem's points. When an exam ends, its total modulo 256 is printed as a character, so a text of 12 letters needs 12 exams.

The machine

LineDoes
==Begin Exam 1==Opens exam 1; exams are numbered 1, 2, 3 in order
1. 1+1=? (72 points)Opens problem 1 of this exam, worth 72 points
A. 2Choice A; later choices are B, C and so on
Answer: AEarns the points when choice A is 1+1
==End Exam 1==Prints the exam's score modulo 256 as a character

Any line out of place is a syntax error and nothing is printed. The specification's interpreter collects the text and prints it at the end with console.log, so a newline follows it. There is no input and no loop, so every program stops.

Example

Both exams are passed.

Both exams are passed. The first scores 72, the code of H. The second has a wrong choice A and a right choice B, scores 105 and prints i.

Further

Ideas it shows

Also in Jokes

Write your own in Run Convert a program from Arithmetic

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run arithmetic program.txt

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

shib manual arithmetic

Source

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

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

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