Bingo Optimizer

Enter a program and click Run.

How to Play

Two vertical plexiglass pipes hold up to 12 balls each. Left pipe starts full of green balls. Right pipe starts full of white balls. A bingo drum sits between them.

Write a program using these operations:

A – The bottom ball drops out of the left pipe into the drum.

B – The bottom ball drops out of the right pipe into the drum.

C – A random ball from the drum is placed into the top of the left pipe (it falls down to rest on the others). Only available if the left pipe is not full.

D – A random ball from the drum is placed into the top of the right pipe (it falls down to rest on the others). Only available if the right pipe is not full.

Repeat notation: Nx(...) repeats the contents N times. Nesting works: 3x(2x(AB))ABABABABABAB. Example: 12x(AB)12x(CD) empties both pipes into the drum, then fills them back up.

Goal: Maximize green balls in the right pipe after the program finishes.

Dev mode: Runs once with animation. Staging mode: Runs 100 times and shows the average green balls in the right pipe. Prod mode: Submits your code to the server for official scoring and leaderboard placement.