Add stack-size

Adds a function that returns the size of the specified stack in a given state.
This commit is contained in:
Nic McPhee 2020-11-10 16:14:23 -06:00
parent db085080b3
commit 89f0f3568a

View File

@ -35,6 +35,11 @@
[state stack]
(empty? (get state stack)))
;; Returns the stack size
(defn stack-size
[state stack]
(count (get state stack)))
;; Returns the top item on the stack
(defn peek-stack
[state stack]