Última actividad 1 week ago

An example of a kitchen that can take orders.

june's Avatar june revisó este gist 1 week ago. Ir a la revisión

1 file changed, 114 insertions

kitchen.nv(archivo creado)

@@ -0,0 +1,114 @@
1 + ||:@include: lib/rpn.nv
2 +
3 + ||::(BLT for june and mary)
4 + :vegan:
5 +
6 + ||:pantry: (bread lettuce bacon tomato tempeh)
7 + :menu: BLT
8 +
9 + |:recipe: BLT|
10 + :need: (bread lettuce tomato bacon)
11 +
12 + |:need: bacon :vegan:?|
13 + :need: tempeh
14 +
15 +
16 +
17 +
18 + |----------------------|
19 + |- KITCHEN STAFF ONLY -|
20 + |----------------------|
21 +
22 + |:: ($item for $first and $second)|
23 + :: order $item for $first
24 + :: order $item for $second
25 + |:: ($item for $recipient)|
26 + :: order $item for $recipient
27 +
28 + |:: order $item for $recipient :order number: $id?|
29 + :orders: $id $recipient $item
30 + :: increment the order number
31 +
32 +
33 + ||:: process orders
34 + |:: process orders? :orders: $id $recipient $item|
35 + :: process an order :order: $id $recipient $item
36 + |:: process orders|
37 +
38 + |:: process an order :order: $id $recipient $item :on the menu:|
39 + :: make $item :for: $recipient :id: $id
40 + |:: process an order :order: $id $recipient $item :not available:|
41 + :failed orders: $id $recipient $item
42 + |:: process an order? :order: $id $recipient $item?|
43 + :: check if $item is on the menu
44 +
45 + |:: check if $item is on the menu :menu: $item?|
46 + :: put the menu back
47 + :on the menu:
48 + |:: check if $item is on the menu? :menu: $other|
49 + :checked menu items: $other
50 + |:: check if $item is on the menu|
51 + :not available:
52 +
53 + |:: make $item :all ingredients present:|
54 + :: assemble $item
55 + :: serve $item
56 + |:: make $item :missing ingredients:|
57 + :: mark $item as unavailable
58 + :: cancel the order for $item
59 + |:: make $item?|
60 + :: fetch the recipe for $item
61 + :: check if we have the ingredients
62 +
63 + |:: fetch the recipe for $item|
64 + :recipe: $item
65 +
66 + |:: check if we have the ingredients :not found: $ingredient|
67 + :missing ingredients:
68 + |:: check if we have the ingredients? :found: $ingredient|
69 + :in use: $ingredient
70 + |:: check if we have the ingredients? :need: $ingredient|
71 + :: search for $ingredient
72 + |:: check if we have the ingredients|
73 + :all ingredients present:
74 +
75 + |:: assemble $item? :in use: $ingredient|
76 + |:: assemble $item|
77 +
78 + |:: serve $item :for: $recipient :id: $id|
79 + :fulfilled orders: $id $recipient $item
80 +
81 + |:: mark $item as unavailable :menu: $item|
82 + :: put the menu back
83 + |:: mark $item as unavailable? :menu: $other|
84 + :checked menu items: $other
85 + |:: mark $item as unavailable|
86 + :: put the menu back
87 +
88 + |:: cancel the order for $item? :need: $ingredient|
89 + |:: cancel the order for $item? :in use: $ingredient|
90 + :pantry: $ingredient
91 + |:: cancel the order for $item :for: $recipient :id: $id|
92 + :failed orders: $id $recipient $item
93 +
94 + |:: put the menu back? :checked menu items: $item|
95 + :menu: $item
96 + |:: put the menu back|
97 +
98 + |:: search for $ingredient :pantry: $ingredient|
99 + :found: $ingredient
100 + |:: search for $ingredient? :pantry: $other|
101 + :out of the way: $other
102 + |:: search for $ingredient|
103 + :: re-stock the pantry
104 + :not found: $ingredient
105 +
106 + |:: re-stock the pantry? :out of the way: $ingredient|
107 + :pantry: $ingredient
108 + |:: re-stock the pantry|
109 +
110 + ||:order number: 0
111 + |:: increment the order number :@rpn data: $id|
112 + :order number: $id
113 + |:: increment the order number? :order number: $id|
114 + :@rpn: ($id 1 +)
Siguiente Anterior