Skip to content

nchurch/go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Usage

Input boards like this:

(def board 
  [[:s :s :s :s :s]
   [:s :s :b :b :s]
   [:s :b :w :w :b]
   [:s :b :w :w :b]
   [:s :s :b :b :s]])

To test if a piece at a given index is alive, write e.g.

(alive? [3 3] board)

Likewise:

(dead? [3 3] board)

You can count all the "paths to life" by running

(alive-all [1 3] board)

To make (and nicely format) the first two 6X6 boards for which black is dead at [3 3], put:

(format-boards (make-boards 2 [6 6] :b dead [3 3]))

Take a look at the code for alive or dead to see core.logic in action.

Issues

Generating large boards does not work. Since you cannot create a function with more than 256 arguments, you cannot generate a board with more than 256 variables.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published