func draw(board Board, l *controller.Launchpad) { if monochrome == false { l.AllGridLightsOn(OFF_COLOR) } for x := 0; x < len(board); x++ { for y := 0; y < len(board[x]); y++ { if board[x][y] { l.LightOnXY(x, y, ON_COLOR) } } } }
func redraw(board, nextBoard Board, l *controller.Launchpad) { for x := 0; x < len(board); x++ { for y := 0; y < len(board[x]); y++ { if board[x][y] != nextBoard[x][y] { if nextBoard[x][y] { l.LightOnXY(x, y, ON_COLOR) } else { if monochrome == false { l.LightOnXY(x, y, OFF_COLOR) } else { l.LightOffXY(x, y) } } } } } }