june / Fridge Simulation
0 gustos
0 bifurcaciones
1 archivos
Última actividad 4 months ago
Putting groceries away in the fridge.
| 1 | ||:@include: lib/rpn.nv |
| 2 | |
| 3 | |:groceries: $item| |
| 4 | :: put $item in the fridge |
| 5 | |
| 6 | |:: put $item in the fridge :fridge: $item $quantity?| |
| 7 | :: put $item in its bin |
| 8 | :: close all the bins |
| 9 | |:: put $item in the fridge? :fridge: $other $quantity| |
| 10 | :checked bins: $other $quantity |
june / Command Parser
0 gustos
0 bifurcaciones
1 archivos
Última actividad 4 months ago
A simple command parser.
| 1 | |:: read a line? :@stdio: (10 $x)| |
| 2 | :@stdio: 10 |
| 3 | :buffer: $x |
| 4 | |:: read a line :@stdio: 10| |
| 5 | |:: read a line?| |
| 6 | :@stdio: read |
| 7 | |
| 8 | |:: print the buffer? :buffer: $x| |
| 9 | :@stdio: write $x |
| 10 | |:: print the buffer| |
june / Kitchen Simulation
0 gustos
0 bifurcaciones
1 archivos
Última actividad 4 months ago
An example of a kitchen that can take orders.
| 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) |
june / Parser (Skeleton)
0 gustos
0 bifurcaciones
1 archivos
Última actividad 4 months ago
The skeleton of a symbol stream parser.
| 1 | > "State:" Pending |
| 2 | "Symbols:" 0 |
| 3 | > "State:" Fact |
| 4 | |
| 5 | > "State:" Pending |
| 6 | "Symbols:" $any |
| 7 | > "State:" Left |
| 8 | |
| 9 | > "State:" Left |
| 10 | "Symbols:" 0 |
june / A basic for-each/fold pattern.
0 gustos
0 bifurcaciones
1 archivos
Última actividad 5 months ago
| 1 | ||:@include: lib/rpn.nv |
| 2 | |
| 3 | |:: push $x to $y| |
| 4 | :stacks: $y $x |
| 5 | |:: pop from $x :stacks: $x $y| |
| 6 | :item: $y |
| 7 | |:: pop from $x? :stacks: $y $z| |
| 8 | :seen: $y $z |
| 9 | |:: pop from $x| |
| 10 | :stack empty: $x |