func generateGrid1(coords []Coord, dimX int, dimY int) [][]uint8 {
	grid := init2dSlice(dimY, dimX)
	for x := 0; x < dimX; x++ {
		for y := 0; y < dimY; y++ {
			shortestDistance := 500
			closestNeighbor := 0
			for _, coord := range coords {
				dist := manhattenDistance(coord.x, coord.y, x, y)
				if dist < shortestDistance {
					shortestDistance = dist
					closestNeighbor = coord.id
				} else if (dist == shortestDistance) {
					closestNeighbor = 0 // 0 represents a tie (multiple closest neighbors)
				}
			}
			grid[y][x] = uint8(closestNeighbor)
		}
	}
	return grid
}
// generate a 2D slice (grid) with solution1 mapping (value = closest coord#)
generate a 2D slice (grid) with solution1 mapping (value = closest coord#)
// generate a 2D slice ( grid ) with solution1 mapping ( value = closest coord# )
func generateGrid1(coords []Coord, dimX int, dimY int) [][]uint8 {
	grid := init2dSlice(dimY, dimX)
	for x := 0; x < dimX; x++ {
		for y := 0; y < dimY; y++ {
			shortestDistance := 500
			closestNeighbor := 0
			for _, coord := range coords {
				dist := manhattenDistance(coord.x, coord.y, x, y)
				if dist < shortestDistance {
					shortestDistance = dist
					closestNeighbor = coord.id
				} else if (dist == shortestDistance) {
					closestNeighbor = 0 
				}
			}
			grid[y][x] = uint8(closestNeighbor)
		}
	}
	return grid
}
func generateGrid1 ( coords [ ] Coord , dimX int , dimY int ) [ ] [ ] uint8 { grid := init2dSlice ( dimY , dimX ) for x := 0 ; x < dimX ; x ++ { for y := 0 ; y < dimY ; y ++ { shortestDistance := 500 closestNeighbor := 0 for _ , coord := range coords { dist := manhattenDistance ( coord . x , coord . y , x , y ) if dist < shortestDistance { shortestDistance = dist closestNeighbor = coord . id } else if ( dist == shortestDistance ) { closestNeighbor = 0 } } grid [ y ] [ x ] = uint8 ( closestNeighbor ) } } return grid }
generate a 2D slice (grid) with solution1 mapping (value = closest coord#)
generate a 2D slice ( grid ) with solution1 mapping ( value = closest coord# )
// 0 represents a tie (multiple closest neighbors)