Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 960 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 960 Bytes

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.