Peaceful chess queen armies: Difference between revisions
Content added Content deleted
Line 2,586: | Line 2,586: | ||
There are two Fortran programs and a driver script. One program generates a Fortran module for basic operations; the other program (which must be linked with the generated module) does the actual work. The driver script is for Unix shell. |
There are two Fortran programs and a driver script. One program generates a Fortran module for basic operations; the other program (which must be linked with the generated module) does the actual work. The driver script is for Unix shell. |
||
For speed, armies are represented by 64-bit or 128-bit integers, depending on the value of n. A 1-bit represets a queen. Rotations and reflections of the board are elemental integer operations on an army. Checking for any attacks is an elemental integer-to-boolean operation on the two armies (though the program detects rook-like attacks by a different mechanism). Equivalence under interchange of the colors can be tested by reversing which army gets which integer value. |
|||
⚫ | |||
⚫ | |||
<lang fortran>program peaceful_queens_elements_generator |
<lang fortran>program peaceful_queens_elements_generator |
||
use, intrinsic :: iso_fortran_env, only: int64 |
use, intrinsic :: iso_fortran_env, only: int64 |