VKoptev / hex

Realisation of hexagonal geometry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hex

GoDoc

Realization of hexagonal grids

This library is representation of hexagonal grids that describe in article from Red Blob Games

How to use

package main

import (
	"fmt"
	
	"github.com/VKoptev/hex"
)

func main() {
	h := hex.New(1, 2)

	fmt.Printf("equal: %v", h.Equal(hex.ZE))
	fmt.Printf("to east: %v", h.Add(hex.EE))
	fmt.Printf("to west: %v", h.Sub(hex.EE))
	fmt.Printf("no way: %v", hex.ZE.Mul(10))
	// ...
}

About

Realisation of hexagonal geometry

License:MIT License


Languages

Language:Go 95.0%Language:Makefile 5.0%