Wednesday, December 29, 2021

Chess 960 posible starting positions

Examples in several programming languages
http://rosettacode.org/wiki/Generate_Chess960_starting_position

All the positions with the standard ID number
https://chess960.net/wp-content/uploads/2018/02/chess960-starting-positions.pdf

https://www.chessprogramming.org/Chess960

https://github.com/MichaelB7/Chess960-Lookup/blob/master/src/960v09.c

https://en.wikipedia.org/wiki/Fischer_Random_Chess_starting_position

Very good explanation of the rules
https://codegolf.stackexchange.com/questions/12322/chess960-position-lookup/12333#12333

B   B   Q   N   N   R K R
4 * 4 * 6 * 5 * 4 * 1     = 1920

Bishops have to be of different colors (4 black squares, 4 whites squares).

There is only 1 possible position for the King and Rooks because it has to go
between the Rooks and there are only 3 squares available at that time.

Because the Knights change color when they move they could be interchanged
without any difference then 5 * 4 should be divided by 2 then
total number of positions = 960.

Tmux commands

# List sessions
# Alias ls
tmux list-sessions
tmux ls

# Create new session
# It is good practice to name sessions
tmux new -s right_window

# Detach a session
Ctrl-b d

# Attach a session using name
tmux a -t right_window

# Use mouse to select pane
Ctrl-b :
# then type
set -g mouse on

# Zoom a pane
Ctrl-b z

# Scroll
Ctrl-b [
# Quit
q

Backup bash script

https://github.com/64board/Bash/blob/main/backup.sh

 

Perl sort example

Sorting in Perl with user defined subroutines.

https://github.com/64board/Perl/blob/main/sort.pl

Perl Getopt::Std example

Example of using Getopt::Std module.

https://github.com/64board/Perl/blob/main/get_opt.pl