8000 GitHub - robinhouston/solitaire: Search (fruitlessly) for a palindromic solution to Solitaire
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

robinhouston/solitaire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solitaire

This repository contains some code to analyse reachable positions in Solitaire, played on the traditional cross-shaped English board with 33 holes, starting from the position where all but the central hole are filled.

The reason I wrote this is to discover whether there are any reachable 17-peg positions that have a certain sort of symmetry. (Spoiler: there are not.) The soli program implements this search.

The same data structures can also easily be used to find out how many reachable positions there are after some number of jumps: this is implemented by the seq program.

Usage

Assuming you have a standard Unix-like development environment, usage should be as simple as

make soli && ./soli

or

make seq && ./seq

Data structures

A board position is represented by a 64-bit unsigned integer, of which only the least-significant 33 bits are used, corresponding to the 33 holes in the board. Sets of boards are represented by a simple binary tree with 33 levels, one for each bit.

About

Search (fruitlessly) for a palindromic solution to Solitaire

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0