()
| 25 | } |
| 26 | |
| 27 | func (state *State) DoMove() interface{} { |
| 28 | rnd := state.Worker.Rnd |
| 29 | oldState := state.Copy() |
| 30 | state.Shape.Mutate() |
| 31 | if state.MutateAlpha { |
| 32 | state.Alpha = clampInt(state.Alpha+rnd.Intn(21)-10, 1, 255) |
| 33 | } |
| 34 | state.Score = -1 |
| 35 | return oldState |
| 36 | } |
| 37 | |
| 38 | func (state *State) UndoMove(undo interface{}) { |
| 39 | oldState := undo.(*State) |