// NewGrid returns a new grid with given width and height in cells. The width
// and height should be positive or null. The new grid contains all positions
// (X,Y) with 0 <= X < w and 0 <= Y < h. The grid is filled with the zero
// value for cells.
NewGrid returns a new grid with given width and height in cells. The width
and height should be positive or null. The new grid contains all positions
(X,Y) with 0 <= X < w and 0 <= Y < h. The grid is filled with the zero
value for cells.
// NewGrid returns a new grid with given width and height in cells . The width // and height should be positive or null . The new grid contains all positions // ( X Y ) with 0 < = X < w and 0 < = Y < h . The grid is filled with the zero // value for cells .
func NewGrid(w, h int) Grid {
	gd := Grid{}
	gd.Ug = &grid{}
	if w < 0 || h < 0 {
		panic(fmt.Sprintf("negative dimensions: NewGrid(%d,%d)", w, h))
	}
	gd.Rg.Max = gruid.Point{w, h}
	gd.Ug.Width = w
	gd.Ug.Height = h
	gd.Ug.Cells = make([]Cell, w*h)
	return gd
}
func NewGrid ( w , h int ) Grid { gd := Grid { } gd . Ug = & grid { } if w < 0 || h < 0 { panic ( fmt . Sprintf ( " " , w , h ) ) } gd . Rg . Max = gruid . Point { w , h } gd . Ug . Width = w gd . Ug . Height = h gd . Ug . Cells = make ( [ ] Cell , w * h ) return gd }
NewGrid returns a new grid with given width and height in cells.
NewGrid returns a new grid with given width and height in cells .