Skip to content

DeShrike/knights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knights

See Numberphile videos:

https://www.youtube.com/watch?v=UiX4CFIiegM

https://www.youtube.com/watch?v=VgmDuBCayPw

All code was written by me, without the use of AI/LLM.

Dependencies

This program uses libpng.

To install on Debian based systems:

sudo apt-get install libpng-dev

Quick start

Clone this repo and then do:

cd knights
make
./knights Knight-Knight 256 output.png

The first parameter defines the opponents.

Possible opponents are:

Knight, Dromedary, Alfil, Antilope, Dabbaba, Wazir, Zebra, Ferz, Manis, Sipius, Xoch.

The maximum opponents is currently 20.

The second parameter is the size of the output image.

256 = 256 x 256 pixels.

Should be an even number not greater than 2048.

Pieces

Knight

.......
..X.X..
.X...X.
...#...
.X...X.
..X.X..
.......

Alfil

.......
.X...X.
.......
...#...
.......
.X...X.
.......

Dromedary

.........
....X....
.........
.........
.X..#..X.
.........
.........
....X....
.........

Antilope

...........
..X.....X..
.X.......X.
...........
...........
.....#.....
...........
...........
.X.......X.
..X.....X..
...........

Wazir

.....
..X..
.X#X.
..X..
.....

Zebra

.........
..X...X..
.X.....X.
.........
....#....
.........
.X.....X.
..X...X..
.........

Ferz

.....
.X.X.
..#..
.X.X.
.....

Mantis

.........
...X.X...
.........
.X.....X.
....#....
.X.....X.
.........
...X.X...
.........

Sipius

...........
...X...X...
...........
.X.......X.
...........
.....#.....
...........
.X.......X.
...........
...X...X...
...........

Xoch

...........
...X...X...
...........
.X.X...X.X.
...........
.....#.....
...........
.X.X...X.X.
...........
...X...X...
...........

To try

Examples from the Numberphile video:

./knights Knight-Knight 1024 out.png

Knight-Knight

./knights Knight-Knight-Knight 1024 out.png

Knight-Knight-Knight

./knights Knight-Knight-Knight-Knight 1024 out.png

Knight-Knight-Knight-Knight

./knights Knight-Knight-Knight-Knight-Knight 1024 out.png

Knight-Knight-Knight-Knight-Knight

./knights Alfil-Dromedary 1024 out.png

Alfil-Dromedary

./knights Knight-Antilope 1024 out.png

Knight-Antilope

./knights Knight-Dabbaba-Wazir-Wazir 1024 out.png

This one is different from the image shown in the video. I think they did something wrong.

Knight-Dabbaba-Wazir-Wazir

./knights Knight-Zebra 1024 out.png

Knight-Zebra

./knights Wazir-Ferz-Wazir-Ferz 1024 out.png

Wazir-Ferz-Wazir-Ferz

A few new ones:

./knights Knight-Xoch-Xoch 1024 out.png

Knight-Xoch-Xoch

./knights Mantis-Sipius-Xoch 1024 out.png

Mantis-Sipius-Xoch

./knights Xoch-Ferz-Wazir 1024 out.png

Xoch-Ferz-Wazir

./knights Alfil-Mantis-Wazir 1024 out.png

Alfil-Mantis-Wazir

./knights Dabbaba-Knight-Zebra 1024 out.png

Dabbaba-Knight-Zebra

./knights Zebra-Ferz-Wazir 1024 out.png

Zebra-Ferz-Wazir

./knights Antilope-Knight-Sipius 1024 out.png

Antilope-Knight-Sipius

./knights Dromedary-Mantis-Knight 1024 out.png

Dromedary-Mantis-Knight

./knights Knight-Dabbaba-Antilope-Wazir 1024 out.png

Knight-Dabbaba-Antilope-Wazir

./knights Knight-Dromedary-Alfil-Wazir 1024 out.png

Knight-Dromedary-Alfil-Wazir

./knights Xoch-Xoch-Mantis-Xoch-Xoch 1024 out.png

Xoch-Xoch-Mantis-Xoch-Xoch

About

Pieces on a spiral chess board

Topics

Resources

License

Stars

Watchers

Forks

Contributors