summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorblob8108 <blob8108@gmail.com>2014-01-05 23:43:20 +0000
committerblob8108 <blob8108@gmail.com>2014-01-05 23:43:20 +0000
commit7c6c4f092ef5b4fdaab767e53642e952a6d12ac2 (patch)
tree635dfb1e801daefa118d6116c37e777146fed3aa /example.py
parentaebd5fca0d44cb98f7aad913bb8abe77261e8065 (diff)
downloadblockext-7c6c4f092ef5b4fdaab767e53642e952a6d12ac2.tar.gz
blockext-7c6c4f092ef5b4fdaab767e53642e952a6d12ac2.zip
Move further examples to separate file
Diffstat (limited to 'example.py')
-rw-r--r--example.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/example.py b/example.py
index 8eb0638..e066c05 100644
--- a/example.py
+++ b/example.py
@@ -34,63 +34,6 @@ def pizza_colour(pizza="tomato"):
def id(text):
return text
-
-
-"""
-@predicate("true or false")
-def tf():
- import random
- return random.choice((True, False))
-
-@reporter("numify %b")
-def numify(value):
- return int(not value)
-
-@command("set light to %b")
-def set_light(boolean_value):
- print("light is {}".format("on" if boolean_value else "off"))
-
-menu("city", ["Boston", "Bournemouth", "Barcelona", "Belgium"])
-
-@reporter("lookup weather in %m.city", blocking=True)
-def weather(city="Boston"):
- import time
- return "{weather} in {city}".format(city=city,
- weather=["sunny", "cloudy", "rainy", "snowy"][int(time.time() % 4)])
-
-menu("motor", [1, 2, 3, "A", "B", "C"])
-
-@command("move motor %d.motor by %n degrees", blocking=True)
-def move_motor(motor="A", angle=4):
- print "move {motor} by {angle} degrees!".format(motor=motor, angle=angle)
- time.sleep(1)
- print "..."
-
-@reporter("light sensor value")
-def light():
- import random
- return random.randint(0, 100)
-
-@command("drive %n steps")
-def move(steps):
- print("." * steps)
-
-
- [" ", "beep", "playBeep"],
- [" ", "set beep volume to %n", "setVolume", 5],
- ["r", "beep volume", "volume"],
- [" ", "order %m.pizzaFlavour pizza for %m.deliverOrCollect",
- "orderPizza"],
- ["r", "colour of %m.pizzaFlavour pizza", "pizzaColour"],
- ["r", "random upto %n", "randomThingy"]
- ],
- "menus": {
- "pizzaFlavour": ["tomato", "cheese", "mozarella", "hawaiian"],
- "deliverOrCollect": ["delivery", "collection"]
- }
- }
-"""
-
@problem
def my_problem():
return "The Scratch Sensor board is not connected. Foo."