summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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