Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Placing Differently Colored Chess Knights in a Spiral

For two or more colors, consider placing knights on an infinite chessboard, spiraling out from the center.

The colors take turns placing knights. Each color places a knight at the earliest possible place in the spiral that is both not occupied and is not attacked by a knight of another color.

What is the resulting placement of the knights?

Inspired by this Numberphile video.

example for 10 colors and up to 10000 knights

example for 2 colors and up to 100000 knights

Requirements:

  • make
  • /bin/sh
  • head
  • gnuplot
  • a C++20 compiler

The convention is file names C@K.png for C colors and K knights, e.g. for 2 colors and 1000 knights:

$ make 2@1000.png

About

place differently colored chess knights in a spiral

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages