summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Anderson <jandew+dev@gmail.com>2016-02-24 10:12:32 -0800
committerJoe Anderson <jandew+dev@gmail.com>2016-02-25 06:37:00 -0800
commitfa8d032a5dbe115f15dc1e5f992f2065957a868e (patch)
treebf84647cd5f30c562e9a1c0afcd512c3128db7a5
parent1999a58cee723c5f2d8e10ead22676a3e6d2300a (diff)
downloadoo-master.tar.gz
oo-master.zip
add in show solution, but not undo buttonHEADmaster
-rw-r--r--oo.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/oo.py b/oo.py
index e1f2e4a..088e426 100644
--- a/oo.py
+++ b/oo.py
@@ -887,10 +887,12 @@ class ooPlay:
" including fixed",
{})}
),
- "G": ("New | Quit",
+ "G": ("New | Quit | Solve",
{"N": ("use n to start a new game",
{}),
"Q": ("use q to quit the program",
+ {}),
+ "S": ("use S to show a solution",
{})}
),
"T": ("Show errors | Inverted | Toroidal | eXtra hard",
@@ -963,12 +965,19 @@ class ooPlay:
self.new_game()
elif inp in "H":
self.write_help()
- elif inp in "Ss":
+ elif inp in "S":
+ self.write("show a solution")
+ for position in self.fixed:
+ self.fixed[position] = False
+ self.puzzle.set_data_from_edges(data='pieces')
+ self.display()
+ self.write()
+ elif inp in "s":
self.write("do NOT "*self.show_errors + "show errors")
self.show_errors = not self.show_errors
self.display()
self.write()
- #TODO: add in show solution, with undo option
+ #TODO: add in an undo button
elif inp in "Ii":
self.write("puzzle is now"
+ " NOT"*self.inverted