Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
0ca5e77d7a
3
.gitignore
vendored
3
.gitignore
vendored
@ -10,3 +10,6 @@ pom.xml.asc
|
|||||||
/.nrepl-port
|
/.nrepl-port
|
||||||
.hgignore
|
.hgignore
|
||||||
.hg/
|
.hg/
|
||||||
|
out
|
||||||
|
notes
|
||||||
|
.idea/
|
@ -37,7 +37,7 @@
|
|||||||
(defn random-float [] (- (* (rand) 200) 100.0))
|
(defn random-float [] (- (* (rand) 200) 100.0))
|
||||||
|
|
||||||
; Random integer between -100 and 100
|
; Random integer between -100 and 100
|
||||||
(defn random-int [] (- (rand-int 201) 100.0))
|
(defn random-int [] (- (rand-int 201) 100))
|
||||||
|
|
||||||
(def instructions
|
(def instructions
|
||||||
(utils/not-lazy
|
(utils/not-lazy
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
;; =============================================================================
|
;; =============================================================================
|
||||||
|
|
||||||
; Random integer between -100 and 100
|
; Random integer between -100 and 100
|
||||||
(defn random-int [] (- (rand-int 201) 100.0))
|
(defn random-int [] (- (rand-int 201) 100))
|
||||||
|
|
||||||
(def instructions
|
(def instructions
|
||||||
(utils/not-lazy
|
(utils/not-lazy
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
;; Returns the top item on the stack
|
;; Returns the top item on the stack
|
||||||
(defn peek-stack
|
(defn peek-stack
|
||||||
[state stack]
|
[state stack]
|
||||||
(if-let [top-item (first (get state stack))]
|
(if (empty? (get state stack))
|
||||||
top-item
|
:no-stack-item
|
||||||
:no-stack-item))
|
(first (get state stack))))
|
||||||
|
|
||||||
;; Returns the top n items on the stack, as a chunk. If there are less than n
|
;; Returns the top n items on the stack, as a chunk. If there are less than n
|
||||||
;; items on the stack, returns the entire stack
|
;; items on the stack, returns the entire stack
|
||||||
|
Loading…
x
Reference in New Issue
Block a user