15 lines
395 B
Plaintext
15 lines
395 B
Plaintext
let command = [:forward, 100]
|
|
|
|
match command with {
|
|
(:goto, (x, y)) -> "goto: {x} and {y}"
|
|
[:one, :two] -> :no
|
|
(:home) -> "go home!"
|
|
& (:clear) -> "clear the screen"
|
|
& (:right, turns) -> "make {turns} to the right"
|
|
& (:left, turns) -> "turn left! by {turns}"
|
|
(:forward, steps) -> "forward {steps} turtle paces"
|
|
(:back, steps) -> "flip it and reverse it {steps}"
|
|
[...xs] -> :splatted
|
|
}
|
|
|