-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfetch.clj
More file actions
27 lines (26 loc) · 775 Bytes
/
fetch.clj
File metadata and controls
27 lines (26 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(defn fetch-from-pantry
([ingredient]
(fetch-from-pantry ingredient 1))
([ingredient amount]
(if (from-pantry? ingredient)
(do
(go-to :pantry)
(dotimes [i amount]
(load-up ingredient))
(go-to :prep-area)
(dotimes [i amount]
(unload ingredient)))
(error "fetch-from-pantry cannot fetch" ingredient))))
(defn fetch-from-fridge
([ingredient]
(fetch-from-fridge ingredient 1))
([ingredient amount]
(if (from-fridge? ingredient)
(do
(go-to :fridge)
(dotimes [i amount]
(load-up ingredient))
(go-to :prep-area)
(dotimes [i amount]
(unload ingredient)))
(error "fetch-from-fridge cannot fetch" ingredient))))