Skip to content

Latest commit

 

History

History
156 lines (107 loc) · 3.24 KB

DOC.md

File metadata and controls

156 lines (107 loc) · 3.24 KB

gSandpiles

Index

Variables

var timeImg = time.Time{}

var timeStart = time.Time{}

func Seconds2Days(s float64) string

Convert seconds to days, hours, minutes and seconds

func main

func main()

type grid

Grid struct

type grid struct {
    Width   int
    Height  int
    Bits    int
    RunTime float64
    Cells   []int
}

func NewGrid

func NewGrid(w, h, b int, rt float64) grid

Create a new grid with the given width, height, bits and runtime

func (*grid) Get

func (g *grid) Get(x, y int) int

Get the value of the cell at x, y

func (*grid) Resize

func (g *grid) Resize(w, h int) grid

Resize the grid to the new size. Copying the old grid to the center of the new grid

func (*grid) SaveImage

func (g *grid) SaveImage()

Save the image to disk

func (*grid) Set

func (g *grid) Set(x, y, v int)

Set the value of the cell at x, y

func (*grid) StartReport

func (g *grid) StartReport()

func (*grid) Topple

func (g *grid) Topple()

Topple the grid. Stopping only to resize the grid if the grid is too small

type system

System struct

type system struct {
    Width     int
    Height    int
    BitsStart int
    BitsEnd   int
    Resume    bool
    Unique    string // Unique part of the filenames
    LastSave  string
}

var Grid grid

var System system

Generated by gomarkdoc