diff options
Diffstat (limited to 'go/game/stack.go')
| -rw-r--r-- | go/game/stack.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/go/game/stack.go b/go/game/stack.go index 4d2a056e..bb93f40c 100644 --- a/go/game/stack.go +++ b/go/game/stack.go @@ -21,6 +21,16 @@ func (s *Stack) push(a Action) { s.Actions = append(s.Actions, a) } +func (s *Stack) remove(a Action) { + for i, o := range s.Actions { + if o != a { + continue + } + s.Actions = append(s.Actions[:i], s.Actions[i+1:]...) + return + } +} + func (s *Stack) pop() { l := len(s.Actions) if l == 0 { |
