Hnefatafl, also known as viking chess, is an easy to learn difficult to master game, just like regular chess.
In this game, there are 2 teams with opposing objectives. The attack team, the one that starts, has as goal to capture the King, while the defending team tries to put the King to safety.
There are only 2 different types of pieces: normal pieces, or as I like to call them, Soldiers, and the King, which is the piece that starts at the center, and there is only 1.
In their turn, each player can move one piece. The pieces move only horizontally and vertically, but as many cells as they want, without going through another piece, just like rook in chess.
To capture an enemy Soldier, it has to be sandwiched between 2 of your pieces.
But to capture the King, all 4 sides of it have to be covered.
For more information about the rules, check out this webpage, that explains everything much better than I: http://aagenielsen.dk/fetlar_rules_en.php
Thanks to Akua21 for the pixel art and the help with some parts of the code.
I did started to do a bot that plays against you, but I didn't do a good job in the overall programming, as this is my first project with the p5 library, and the code is a bit of a mess, and when I tried to make the bot it was quite complicated. I may try to do it again in the future.