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.
uncertainIdx(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 descriptionwant = roundCapmost it may teach this round (the round cap)...IF budgetLeft < want THEN want = budgetLeft...but never more than the budget it has lefttaught = 0count of lessons taught so far this roundr = 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 handWENDend of the loopi = 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 notebookWENDend of the loopx = endRound()done for this round: the students go studyRun 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).
export PATH=$HOME/.nimby/nim-2.2.10/bin:$PATH export POLYWORLD_DEPS=$HOME/.nimby/pkgs
nim c -d:headless -o:out/tutor src/tutor.nim
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.jsonIt 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], ...}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:
| seed | starter | uncertainty | random | idle |
|---|---|---|---|---|
| 7 | 740 | 757 | 699 | 480 |
| 8 | 712 | 732 | 694 | 495 |
| 9 | 866 | 867 | 778 | 508 |
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.