EML-P projects

Software written in EML-P

Working programs rather than snippets. Each project is a set of EML-P modules behind a text menu, built on cases from the verified corpus. Its recorded sessions are its test: the language repo replays every one under CPython, and this site’s build replays every one again in the EML interpreter. A session whose screen does not match is not published.

P001

Todo list

Add tasks with a priority, mark them done, delete them, and list them in the order added, by priority, or only the ones still pending - from a text menu.

3 modules · 2 recorded sessions
P002

Unit converter

Convert lengths, weights, temperatures and volumes from any unit to any other of the same kind, and back again, with every typed unit and value checked first - from a text menu.

3 modules · 2 recorded sessions
P003

Expense tracker

Record income and expenses by date and category, in whole cents, and see the balance, the totals by category and a report for any month - from a text menu.

4 modules · 2 recorded sessions
P004

Contacts

Add, find, edit and delete contacts, kept in name order by binary search; find by part of a name or part of a number, with every phone number checked - from a text menu.

3 modules · 2 recorded sessions
P005

Gradebook

Students and their scores in three subjects: report cards, a ranking where equal averages share a place, pass or fail, and the class average and median, all worked out exactly - from a text menu.

4 modules · 2 recorded sessions
P006

Inventory

Items with a unit cost and a safety level, stock received and shipped with every movement logged, a warning for anything below its safety level, and the value of the whole stock - from a text menu.

3 modules · 2 recorded sessions
P007

Calculator

Type an expression with + - * / and parentheses; it is turned into postfix and worked out on a stack in exact fractions, so 0.1 + 0.2 is 0.3. Clear error messages, a history and ans for the last answer.

3 modules · 2 recorded sessions
P008

Number guessing

Guess the number at three levels, with higher/lower hints that narrow to a range, a limited number of guesses and a best score per level; the secret numbers come from a random generator written in EML - from a text menu.

3 modules · 2 recorded sessions
P009

Tic-tac-toe

Play tic-tac-toe against a friend or against the computer, which wins when it can and blocks when it must; wins and draws are found and a running score is kept - from a text menu.

3 modules · 2 recorded sessions
P010

Quiz

Take a multiple-choice quiz, get a score, review the questions you missed and retake only those until none are left; every attempt is kept in a score history - from a text menu.

3 modules · 2 recorded sessions
P011

Shopping cart

Fill a cart from a small catalog, change quantities, enter a discount code and check out with a receipt: the subtotal, the one discount taken (the largest that applies - discounts never stack), the tax and the total - from a text menu.

5 modules · 2 recorded sessions
P012

Library loans

Lend books to members and take them back: due dates on a real calendar (leap years included), at most three books each, fines for late returns that must be paid before borrowing again, and new members - from a text menu, with the date moved forward by hand.

4 modules · 2 recorded sessions
P013

Bill splitter

Share expenses among up to eight people - each paid by one, shared equally or in shares, split to the cent by largest remainder - see who owes whom, and settle up in the fewest transfers possible, found exactly by trying every group - from a text menu.

4 modules · 3 recorded sessions
P014

Loan calculator

The monthly payment of a loan, worked out exactly in whole numbers and rounded by a stated rule (to the nearest cent or up to the next), the repayment schedule by year and by month, the last payment that clears the balance to exactly 0.00, and the total paid and total interest - from a text menu.

3 modules · 2 recorded sessions
P015

Date calculator

Days between two dates, the day of the week, a date plus or minus some days, whether a year is a leap year and why, and someone's age on a date - including the two rules for a 29 February birthday - on the Gregorian calendar from 1583 to 9999, from a text menu.

3 modules · 2 recorded sessions
P016

Text statistics

Type several lines of text and see its counts (lines, words, letters, average and longest word), its most common words, a chart of its letters, the palindromes in it - words and whole lines - and the groups of words that are anagrams of each other, from a text menu.

3 modules · 2 recorded sessions
P017

Flashcards

Practise decks of flashcards with Leitner boxes: a card answered right the first time moves up a box, a wrong one goes back to box 1 and comes again at the end of the practice; box k is due every 2^(k-1) practices. Two decks to start, new decks and cards, and a progress chart per deck - from a text menu.

3 modules · 2 recorded sessions
P018

Parking lot

Run an eight-space parking lot: cars come in and go out at typed times, each exit gets a ticket that shows how its fee was worked out - free up to 10 minutes, 3.00 for the first hour, 1.00 for each half hour after, at most 15.00 per 24 hours - and each day has a report of its takings, from a text menu.

3 modules · 2 recorded sessions
P019

Poll

Set up a poll with two to six options, enter ranked ballots (one at a time or many identical ones at once), and count them four ways side by side - plurality, instant runoff round by round, Borda, and head to head - to see when the methods disagree, from a text menu.

3 modules · 3 recorded sessions
P020

Text adventure

Explore an old house of eight rooms on a grid - go, take, drop and use things, light a lamp for the dark cellar, unlock a door with the key found there - and carry the crown out to the garden to win; a map shows the rooms you know, and a path command finds a route through them by backtracking.

4 modules · 2 recorded sessions
P021

Base converter

Convert whole numbers of any length between bases 2 to 36 by long division on their digits, show a number in bases 2, 8, 10 and 16 at once, and turn numbers into Roman numerals and back - refusing a numeral that is not written the standard way and saying how it should be - from a text menu.

4 modules · 2 recorded sessions
P022

Cipher workbench

Encode and decode with the Caesar and Vigenere ciphers - case and punctuation kept, the Vigenere key moving only on letters - and break a Caesar cipher by comparing letter counts with English for every shift; a toy for classical ciphers, not security software, from a text menu.

4 modules · 2 recorded sessions
P023

Number toolkit

Whole-number tools from a text menu: is a number prime (and if not, its smallest factor), its prime factors with powers, the gcd and lcm of several numbers with Euclid's steps for two, the primes in a range by a sieve, a number's divisors - perfect, abundant or deficient - and the perfect numbers up to a limit.

4 modules · 2 recorded sessions
P024

Bracket checker

Checks the round, square and curly brackets of a typed text of up to 20 lines: the first error with its line, column and reason - a bracket that closes nothing, one of the wrong kind, or one never closed - the deepest nesting, and an outline of the text broken at its brackets.

3 modules · 2 recorded sessions
P025

Run-length compressor

Compresses a line of text by writing each long run of one character as ~count~character - only where that is shorter - with ~~ for a ~ in the text, so digits need no escaping; expands it back with the position and reason of any error, gives the compression ratio, and checks that every compressed text expands to the original.

3 modules · 2 recorded sessions
P026

Temperature log

A day's temperature readings from up to six places: each place's lowest, highest and average, a moving average over 2 to 10 readings, and alerts for readings outside a place's safe range - when a reading comes in and in a list. Temperatures are kept in whole tenths of a degree, so the averages are exact until the display rounds them.

3 modules · 2 recorded sessions
P027

CSV viewer

Paste a CSV of up to 30 rows and 8 columns - quoted fields with commas and doubled quotes included - and see it as a table; sort it by a column (numbers or text, stable, empty fields last), filter it by a condition, and get a column's statistics, with numbers kept exact.

3 modules · 2 recorded sessions
P028

Spelling suggester

Checks a line of text against a list of 352 common English words and suggests, for each word it does not know, the closest words by edit distance - insertions, deletions, substitutions and swaps of two neighbouring letters - the more common word first on a tie; suggests for a single word, and adds new words for the session.

3 modules · 2 recorded sessions
P029

Line editor

A text of up to 30 lines edited with short commands - append, insert, replace, delete a line or a range, list, find - with undo and redo on two stacks. Every edit is one splice, and undoing it is the same splice reversed, so the stacks hold changes rather than copies of the text.

2 modules · 2 recorded sessions
P030

Room booking

Books three meeting rooms of 4, 8 and 12 seats over a working week. A booking that overlaps another in the same room is refused, naming the booking it clashes with and the rooms that are free instead - back-to-back bookings do not clash; each day has a schedule, free rooms can be looked up, and bookings can be cancelled.

3 modules · 2 recorded sessions
P031

Shift roster

A week of morning, evening and night shifts for up to 8 people with days off: assign by hand - refused with every rule it would break - or fill automatically, fairest first; a separate audit rechecks the finished roster from scratch against one shift a day, 11 hours of rest, at most 5 shifts a week and no shift on a day off.

2 modules · 2 recorded sessions
P032

Vending machine

Six products with stock and prices; coins of 5 to 200 cents go in, and change comes out with the fewest coins the machine actually holds - found by dynamic programming over a limited coin box, where taking the biggest coin first can fail. If it cannot make the change the sale is refused and the coins come back. Staff restock products and refill the coin box.

2 modules · 2 recorded sessions
P033

Elevator

One lift over floors 0 to 9: people call it from a floor to go to another, time moves on in steps, and the lift keeps its direction while there is a reason to go on and turns round when there is none. Statistics show how long people waited, and the same calls can be run again by a lift that takes one passenger at a time, to compare.

3 modules · 2 recorded sessions
P034

Tournament bracket

A single-elimination bracket for 2 to 16 players typed in seed order: the top seeds get the byes, seeds are placed so that the strongest meet as late as possible, results are typed match by match and winners go through round by round to a champion. A result can be corrected while the winner's next match is still to be played.

3 modules · 2 recorded sessions
P035

Pig (dice game)

The dice game Pig for two players or against the computer: roll as often as you like, every roll adds to the turn, a 1 loses the whole turn, and holding banks it - first to the target wins. The computer holds at 20; the dice come from a random generator written in EML, so a seed always gives the same game, and a tally shows how often each face came up.

4 modules · 2 recorded sessions
P036

Game of Life

Conway's Game of Life on a 12 x 20 board: edit cells or pick a ready-made pattern, then run a generation at a time or many at once. Every board is remembered with the generation it first appeared in, so the program says when the board has died, stopped changing, or started to repeat - and with what period.

3 modules · 2 recorded sessions
P037

Pixel paint

A 12 x 24 canvas of characters: paint single cells, Bresenham lines and boxes with the pen's color, fill an area with the paint bucket, switch pens (one of them erases), and undo as far back as you like. The canvas is a dictionary keyed by (row, column) tuples.

3 modules · 2 recorded sessions
P038

Matrix calculator

Up to three matrices of at most 5 x 5, typed with whole numbers, fractions or decimals and kept as exact fractions: sum, difference, product, a number times a matrix, transpose, the determinant by Gaussian elimination and the inverse by Gauss-Jordan elimination - checked by multiplying back. Each result is kept as R for the next operation.

3 modules · 2 recorded sessions
P039

Task planner

Tasks with a length in days and the tasks each one needs first: an order that respects every dependency (Kahn's algorithm), each task's earliest start, finish and slack, a small chart, and the critical path that decides the total. A dependency that closes a cycle is named at once, and no plan is made until the cycle is broken.

2 modules · 2 recorded sessions
P040

Sudoku helper

A 4 x 4 or 9 x 9 sudoku, built in or typed in: put numbers in and take them out with a warning the moment one clashes, check the board (including when it can no longer be completed), ask for a hint that names one sure step, or let a backtracking solver finish it and say whether the solution is the only one.

3 modules · 2 recorded sessions
P041

Maze

A random maze from a seed - the same seed always makes the same maze - built by a random depth-first walk with a few extra walls knocked down so that there is more than one way. Walk it from S to G, or show a shortest way found by breadth-first search beside the way the corpus case's backtracking finds.

3 modules · 2 recorded sessions
P042

Tower of Hanoi

Move a tower of 1 to 8 disks from peg A to peg C, one disk at a time, never a larger disk on a smaller one. Every move is checked; a hint names the best next move, and the program can finish from any position in the fewest moves left - 2^n - 1 from the start.

2 modules · 2 recorded sessions
P043

Line diff

Two texts compared line by line: the longest run of lines they share, in order, stays, and everything else is shown as removed from the first or added in the second - in full with line numbers on both sides, or only the changes with a line of context around each. The texts can be swapped to see the change the other way.

2 modules · 2 recorded sessions
P044

Statistics

A list of numbers - whole numbers, decimals or fractions, kept exact - and what describes it: count, range, mean, median, modes, quartiles and outliers, variance and standard deviation dividing by n and by n - 1, whether the mean sits above or below the median, and a histogram whose top edge does not drop the largest value.

3 modules · 2 recorded sessions
P045

Sorting visualizer

A list of up to 12 numbers sorted step by step by bubble sort, insertion sort, merge sort or counting sort - every pass, insertion or merge shown with the part already in place - with the comparisons and moves each one took, or all four side by side on the same list.

2 modules · 2 recorded sessions
P046

Text formatter

A paragraph set at a width from 20 to 60: left, right, centred or justified, wrapped greedily as a terminal does, or balanced by dynamic programming so that the right edge is as even as it can be - with the raggedness of both wrappings shown side by side.

2 modules · 2 recorded sessions
P047

Minesweeper

Open every cell without a mine on a field of up to 12 x 16: numbers count the mines around a cell, cells with none around open their neighbours by themselves, and flags mark the mines you are sure of. The mines are laid after the first move - never on that cell or next to it - from a seed, so the same seed lays the same field.

3 modules · 2 recorded sessions
P048

2048

Slide the tiles of a 4 x 4 board - or 3 x 3 to 6 x 6 - up, down, left or right: two equal tiles that meet join into one with their sum, each tile once a move, and every move that changes the board brings a new 2 or 4. Reach the goal tile and keep going until no move is left; the same seed brings the same tiles.

3 modules · 2 recorded sessions
P049

Blackjack

Blackjack against the dealer with one deck and a stack of chips: hit, stand or double, aces counted 1 or 11 with soft totals shown, the dealer drawing to 16 and standing on every 17, a blackjack paying 3 to 2. The deck is shuffled by a Fisher-Yates shuffle on EML's own random numbers, so a seed deals the same cards every time.

3 modules · 2 recorded sessions
P050

Connect Four

Drop discs into a grid of 7 columns and 6 rows and be the first with four in a row - across, down or diagonally. Play a friend, or the computer, going first or second: it wins when it can, blocks when it must, and looks one move ahead so as not to set up your win. A running score is kept.

3 modules · 2 recorded sessions
P051

Hangman

Guess a secret word from a list of over a hundred, a letter at a time or the whole word at once, before six wrong guesses finish the drawing. A hint counts, among the words that still fit what you know, how many hold each letter you have not tried. Words come from a seed, none twice until the list is used up.

3 modules · 2 recorded sessions
P052

Binary search tree explorer

A binary search tree of whole numbers: insert keys, delete them - a leaf, a node with one child, or one with two, replaced by its successor - and search with the path shown. Walk it in order, pre-order and post-order, see its size, height, smallest and largest key, and see it drawn on its side.

2 modules · 2 recorded sessions
P053

Help desk queue

Support tickets with four priorities, served most urgent first and first come, first served within a priority, kept in a binary heap. Open, serve, list the line, change a waiting ticket's priority or cancel it, and see the queue grouped by priority next to what has been served.

2 modules · 2 recorded sessions
P054

Sliding puzzle

The 3 x 3 and 4 x 4 sliding puzzles: shuffled boards that are always solvable, typed boards checked by counting the pairs out of order, several tiles slid in one line, and for 3 x 3 the fewest moves found by breadth-first search from both ends.

4 modules · 2 recorded sessions
P055

Habit tracker

Up to five habits checked in on real calendar days: the streak still running, the longest streak, check-ins taken back, and any month drawn as a Monday-first calendar with the days done - dates counted from 1900 and weekdays by Zeller's congruence.

3 modules · 2 recorded sessions
P056

Mini spreadsheet

Cells A1 to F9 holding numbers, labels and formulas - + - * / with parentheses, cell references, SUM, MIN, MAX and AVG over ranges - kept as exact fractions. Every change recalculates the sheet in dependency order (Kahn's algorithm), and formulas caught in a cycle are found and marked instead of looping.

3 modules · 2 recorded sessions
P057

Scales and chords

Major and minor scales and nine kinds of chords from any root, spelled on the right letters (F major has Bb, not A#), intervals named from their letters and semitones with their simple frequency ratio and where the two notes' overtones meet, and chord progressions moved to another key.

3 modules · 2 recorded sessions
P058

Teams and round robin

Split up to 16 rated players into two teams as even as possible - a backtracking search that drops any branch past half - or into three or four by a quick rule; then a league where everyone meets everyone once, scheduled by the circle method, with results entered as they come and a table sorted by points, goal difference and goals.

3 modules · 2 recorded sessions
P059

Workout log

Exercises logged as sets x reps at a weight on real dates, kept exact in tenths of a kilogram: the history day by day, each exercise's heaviest weight and best estimated one-rep max (Epley), and the volume lifted week by week, Monday to Sunday, drawn as a chart that adds back up to the total.

3 modules · 2 recorded sessions
P060

Probability lab

The birthday problem, the Monty Hall game with a host who knows and a host who guesses, and the sum of two dice - each worked out exactly as a fraction and then tried thousands of times on EML's own random numbers, side by side.

4 modules · 2 recorded sessions