added dotmatrix printer funtion

master
Name 2 years ago
parent e86fa60d21
commit d461bc8b1a

@ -1,5 +1,6 @@
#This is a script that writes rules and instructions #This is a script that writes rules and instructions
#First it sets variables #First it sets variables
import os
import random import random
import urllib.request import urllib.request
#games = ["backgammon", "pokemon", "war"] #games = ["backgammon", "pokemon", "war"]
@ -55,22 +56,24 @@ def quantifier (words):
return word + "s" return word + "s"
#print(type(objects)) #print(type(objects))
#print(objects) #print(objects)
def dotprint(text):
os.system('echo "'+text+'"> /dev/usb/lp0')
print(text)
#object = ["teammate", "card", "turn", "place", "board", "dice", "nice", "backgammon"] #object = ["teammate", "card", "turn", "place", "board", "dice", "nice", "backgammon"]
#verb = ["choose", "pick", "give", "burn", "cut"] #verb = ["choose", "pick", "give", "burn", "cut"]
#Then it writes a title #Then it writes a title
print("~*"*60) dotprint("~*"*60)
print("\n" + " " *10+"How to play " + random.choice(gamenames)+"\n") dotprint("\n" + " " *10+"How to play " + random.choice(gamenames)+"\n")
print(random.choice(introductions)) dotprint(random.choice(introductions))
print("\n" + "~*"*60 +"\n") dotprint("\n" + "~*"*60 +"\n")
#Then it loops through instructions #Then it loops through instructions
for i in range(random.randrange(5,10)): for i in range(random.randrange(5,10)):
print("Action " + str(random.randrange(100,1000)) + ": "+ random.choice(verbs) + " " + quantifier (objects) + " with " + random.choice(tools) + " from the " + random.choice(themes) + " section to " + random.choice(spaces)) dotprint("Action " + str(random.randrange(100,1000)) + ": "+ random.choice(verbs) + " " + quantifier (objects) + " with " + random.choice(tools) + " from the " + random.choice(themes) + " section to " + random.choice(spaces))
#f"{a:02}" #f"{a:02}"
print("\n" + "~*"*60 +"\n") dotprint("\n" + "~*"*60 +"\n")
print("After you finish playing the game, please proceed to the pen plotter station to contribute in the collective writing process. (and answer the question How do we library that? or somethin specific) \n") dotprint("After you finish playing the game, please proceed to the pen plotter station to contribute in the collective writing process. (and answer the question How do we library that? or somethin specific) \n")
print(""" dotprint("""
wWWWw wWWWw wWWWw wWWWw
vVVVv (___) wWWWw (___) vVVVv vVVVv (___) wWWWw (___) vVVVv
(___) ~Y~ (___) vVVVv ~Y~ (___) (___) ~Y~ (___) vVVVv ~Y~ (___)

Loading…
Cancel
Save