TinyVM Connect4 Tournament
A silly competition of terrible algorithms trying to play Connect4. Submit your own, and see how well/badly it does! :D
Overview
Tic-tac-toe and Connect4 are solved games, for which unbeatable strategies exist. On the other hand, games like chess and go are too hard to "play around", where a silly algorithm has no real chance to compete at all.
Hence Connect4 on TinyVM: Connect4 is moderately difficult, where playing the perfect strategy still takes a considerable amount of resources. TinyVM, as the name suggests, limits those resources. By executing the algorithms on a virtual CPU, resources like memory and computation time can be tightly controlled. This allows simple algorithms to compete with each other, without having to rely on silly restrictions such as "it has to finish within 1.3 seconds of computation time of my computer".
The basic idea is inspired by Elo World by Tom7. I guess the biggest differences are:
- Let's use Connect4 instead of chess, because it's much much simpler to make a valid move in Connect4.
- Instead of writing all the algorithms myself, enable and encourage everyone else to write and easily compare them.
- Because of that, and also because it's fun in and of itself, write a lot of assembly.
- Try to enforce programmatically that the algorithms don't just brute-force the solution.
- Have a neat website that presents the results. You're currently reading it. In particular I liked the table at the end of Tom7's paper, so I gotta have something similar.
Do you want to add your own algorithm, or perhaps improve the project in some other way?
I'd love to hear your feedback, or any other kind of issue:
https://github.com/BenWiederhake/tinyvm/issues/new
Tournament results
Numbers are wins/draws/losses, with color interpolation as green/blue/red. The row-player goes first, the column-player goes second.
fill_board_with_mod | fill_bottom_up | horizontal_mod | imitate_if_legal | longest_streak | random_legal | random_unchecked | ret0 | slowpoke | |
---|---|---|---|---|---|---|---|---|---|
fill_board_with_mod | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 80/0/20 | 74/0/26 | 0/0/1 | 1/0/0 |
fill_bottom_up | 0/0/1 | 0/0/1 | 1/0/0 | 1/0/0 | 1/0/0 | 70/0/30 | 63/0/37 | 1/0/0 | 1/0/0 |
horizontal_mod | 0/1/0 | 0/0/1 | 1/0/0 | 1/0/0 | 1/0/0 | 53/0/47 | 73/0/27 | 1/0/0 | 1/0/0 |
imitate_if_legal | 12/5/83 | 15/0/85 | 5/6/89 | 100/0/0 | 0/18/82 | 14/11/75 | 62/0/38 | 100/0/0 | 100/0/0 |
longest_streak | 0/0/1 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 96/0/4 | 99/0/1 | 1/0/0 | 1/0/0 |
random_legal | 42/0/58 | 39/0/61 | 57/0/43 | 100/0/0 | 12/0/88 | 58/1/41 | 62/0/38 | 40/0/60 | 62/0/38 |
random_unchecked | 35/0/65 | 41/0/59 | 29/0/71 | 66/0/34 | 9/0/91 | 53/0/47 | 55/0/45 | 28/0/72 | 58/0/42 |
ret0 | 0/0/1 | 1/0/0 | 1/0/0 | 0/0/1 | 1/0/0 | 75/0/25 | 81/0/19 | 0/0/1 | 0/0/1 |
slowpoke | 0/0/1 | 0/0/1 | 0/0/1 | 0/0/1 | 0/0/1 | 57/0/43 | 56/0/44 | 1/0/0 | 0/0/1 |
Write more Connect4 bots!
Come on, let's write even more Connect4 algorithms, the sillier the better!
- A simple algorithm that first plays in the first column, then the second column, etc., is
horizontal_mod.asm
. - A more involved algorithm that tries to imitate the previous player's move (if legal; else, a random legal column), is
imitate_if_legal.asm
. - There is documentation of the assembly language.
- There is documentation of every single instruction.
- If you really want to, there's a lot of tests for every single aspect of the assembler and a lot of tests for every single aspect of the VM / virtual CPU.
- What are you waiting for? Create your own silly bot today!
Epilogue
Live a good life, be kind, advance civilization; and if you somehow manage to make a lot of money from this advice, consider saying thanks by giving me 1% of the profit.
This page was last rebuilt on 2023-06-28 02:02:32 CEST.
The raw data on this webpage is also available as a JSON file.