diff options
author | Julien Dessaux | 2021-09-24 01:26:49 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-24 01:26:49 +0200 |
commit | da7e7dae2b690308fb7ff3aba34145233c740bce (patch) | |
tree | c836da7165fa8ef26f7d7342c08635f0a35b0065 /pkg/pointer/stack.go | |
parent | Implemented commands until helloworld works \o/ (diff) | |
download | gofunge98-da7e7dae2b690308fb7ff3aba34145233c740bce.tar.gz gofunge98-da7e7dae2b690308fb7ff3aba34145233c740bce.tar.bz2 gofunge98-da7e7dae2b690308fb7ff3aba34145233c740bce.zip |
Made the interpreter pass most of the mycology test suite
Diffstat (limited to 'pkg/pointer/stack.go')
-rw-r--r-- | pkg/pointer/stack.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/pointer/stack.go b/pkg/pointer/stack.go index 1832dbb..ba51c7c 100644 --- a/pkg/pointer/stack.go +++ b/pkg/pointer/stack.go @@ -23,6 +23,9 @@ func (s *Stack) Clear() { func (s *Stack) Duplicate() { if s.height > 0 { s.Push(s.data[s.height-1]) + } else { + s.Push(0) + s.Push(0) } } |