aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2022-08-20 09:25:57 +0200
committerJulien Dessaux2022-08-20 09:25:57 +0200
commit544a3f376371750d97e1b17d01d4e522946c2f9d (patch)
tree284aa6789e32ad017259c2634186e92b4b116391
parentFixed bug in the handling of end command failure (diff)
downloadnimfunge98-1.1.2.tar.gz
nimfunge98-1.1.2.tar.bz2
nimfunge98-1.1.2.zip
Fixed stack duplicate behaviour1.1.2
-rw-r--r--src/stack.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stack.nim b/src/stack.nim
index d6493a3..ef7edf8 100644
--- a/src/stack.nim
+++ b/src/stack.nim
@@ -46,8 +46,8 @@ func Clear*(s: var Stack) =
s.height = 0
func Duplicate*(s: var Stack) =
- if s.height > 0:
- s.Push(s.data[s.height-1])
+ let v = s.Pop()
+ s.PushVector((v, v));
func Swap*(s: var Stack) =
let a = s.Pop