Archived
1
0
Fork 0

Finished implementing the stackstack

This commit is contained in:
Julien Dessaux 2021-10-04 20:10:21 +02:00
parent c0393d0ca1
commit c9b3a999bd
4 changed files with 17 additions and 0 deletions

View file

@ -73,6 +73,7 @@ func Transfert*(toss: var Stack, soss: var Stack, n: int) =
soss.height = 0
func Discard*(s: var Stack, n: int) =
## Implements a discard mechanism intended for use with the '}'(aka end) stackstack command
s.height -= n
if s.height < 0:
s.height = 0

View file

@ -25,6 +25,12 @@ func PushVector*(ss: var StackStack, v: tuple[x, y: int]) =
func Clear*(ss: var StackStack) =
ss.head[].Clear()
func Duplicate*(ss: var StackStack) =
ss.head[].Duplicate()
func Swap*(ss: var StackStack) =
ss.head[].Swap()
func Begin*(ss: var StackStack, v: tuple[x, y: int]) =
inc ss.height
let soss = ss.head