Skip to content
VKoptevPublic

About

Realisation of hexagonal geometry

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

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

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages