MCPcopy
hub / github.com/fogleman/primitive / DoMove

Method DoMove

primitive/state.go:27–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func (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
38func (state *State) UndoMove(undo interface{}) {
39 oldState := undo.(*State)

Callers

nothing calls this directly

Calls 3

CopyMethod · 0.95
clampIntFunction · 0.85
MutateMethod · 0.65

Tested by

no test coverage detected