Skip to content

ajroetker/hexlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexlib

A Clojure hex grid resource library.

This library came from constructing a solution for the 2015 ICFP contest's hexagonal tetris problem.

The inspiration for much of this library came from http://www.redblobgames.com/grids/hexagons/.

Leiningen

Clojars Project

Usage

  ; <hex> :- [<col: int> <row: int>]
    (hexlib.core/odd-r->cube <hex>) ;; returns a [<x: int> <y: int> <z: int>]
  ; <problem> :- {defined in the ICFP problem statement}
    (hexlib.loader/load-boards <problem>) ;; returns a [<board>...]
  ; <command> :- `:w` | `:e` | `:se` | `:sw` | `:ccw` | `:cw` 
    (hexlib.tetris/board-transition <board> <command>)
    (hexlib.tetris/score-game <board>)

License

Copyright © 2015 Andrew Roetker

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Hexagonal grid resources for Clojure and ClojureScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published