Teach-OffBack to the game

Make your own AI teacher

The robots are small programs

The robots at the empty desks are tiny BASIC programs, and a program sees exactly what you see.

Each one gets its own student's notebook: the dots are the questions (inputs), and the program is told which ones its student is least sure about. That is the same list as the raised hands. It picks from the same lessons you can, and the engine marks every lesson for it, so a program never sees an answer key, the hidden exam or a score. Your desk and a robot's desk follow the same rules and the same lesson budget.

Tap a handuncertainIdx(r) lists the raised hands (r = 0 is the unsurest), then teachProbe(i) answers one. Tap a dotteachProbe(i) teaches that existing dot. Tap empty paperscratchSet(d, v) sets a made-up point, then teachScratch() teaches it. Study timeendRound() says you are done teaching this round.

The full list (the notebook data, limits and every function) is in docs/basic-api.md in the repo.

The simplest starter

This 18-line teacher asks its student's most-uncertain questions first, and in round 1 (no raised hands yet) just samples the notebook. It is a real file, live/web/ai/starter.bas, and the run below used it. It runs once per tick until it calls endRound().

' Starter teacher: ask my student's most uncertain questions, then end the round.the robot's one-line job description
want = roundCapmost it may teach this round (the round cap)...
IF budgetLeft < want THEN want = budgetLeft...but never more than the budget it has left
taught = 0count of lessons taught so far this round
r = 0start at the student's most-uncertain question (r = 0)
WHILE taught < want AND r < kSignalkeep going until the round is full or the list ends
i = uncertainIdx(r)the r-th question with a raised hand (-1 in round 1: no hands yet)
IF i >= 0 THENa real question? (not -1)
IF probeTaught(i) = 0 THEN taught = taught + teachProbe(i)if it is not taught yet, teach it: same as tapping a hand; add 1 if accepted
END IFend of the check
r = r + 1look at the next raised hand
WENDend of the loop
i = 0round 1 has no hands, so just sample the notebook...
WHILE taught < want AND i < probeCount()...every 7th dot, until the round is full
taught = taught + teachProbe(i)teaching a dot is the same as tapping it
i = i + 7move along the notebook
WENDend of the loop
x = endRound()done for this round: the students go study

Run it yourself

You need a Mac or Linux terminal, git, and Nim 2.2.10 (the system Nim 2.2.6 is too old; it is installed with nimby).

Get the code. The source kit (the runner, the robots and this starter) is not public yet; the download link goes here when it is. Until then you can read and edit the starter below.
Point at the toolchain.
export PATH=$HOME/.nimby/nim-2.2.10/bin:$PATH
export POLYWORLD_DEPS=$HOME/.nimby/pkgs
Build the runner (about 15 seconds).
nim c -d:headless -o:out/tutor src/tutor.nim
Run your teacher against the robots, one desk each, and save the scores.
out/tutor --bot live/web/ai/starter.bas:1 \
  --bot players/uncertainty.bas:1 \
  --bot players/random.bas:1 \
  --bot players/idle.bas:1 \
  --seed 7 --results /tmp/r.json
It prints the exam score (out of 1000) for every desk after every round, then the final scores are in /tmp/r.json. Real output, seed 7, last rows:
round exam permille by seat          lessons taught
 9   [747, 750, 709, 480]   [135, 135, 135, 0]
10   [740, 757, 699, 480]   [150, 150, 150, 0]
results saved: /tmp/r.json
{"scores":[740,757,699,480], ...}
Compare. Seat 0 is your teacher; scores lists seats 0 to 3. Try other seeds, since one seed is a small sample. What I got when I ran seeds 7, 8 and 9:
seedstarteruncertaintyrandomidle
7740757699480
8712732694495
9866867778508
The starter beats random and idle and sits close behind the shipped uncertainty.bas. Beating the robots is the game: copy the file, change it, and run again. mixed.bas shows how to teach made-up points.

Put it in the live league coming soon

Sending your program to the live server, so that it takes your desk when you step away, is not available yet. Today the desks are filled by the four built-in robots, and your own programs run on your computer with the steps above. When submitting opens, this page will say so and show how.