From a3ca136cd776ff0089dc33e401d1fc474dc17138 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 8 Sep 2025 15:38:07 +0200 Subject: support explicitly winning and implement Approach Supremacy! --- go/game/stack.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'go/game/stack.go') 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 { -- cgit v1.2.3