Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stone <michael@laptop.org>2011-01-08 06:14:25 (GMT)
committer Michael Stone <michael@laptop.org>2011-01-08 06:32:12 (GMT)
commit757c06875f988f5bb81c3b877b22e051c95eaaa5 (patch)
treee0fdbfc2a28a214f5ffd6dcd660075e6d6c2c52a
parent7f19921a912c13d36d00a83efb295cd45e871f61 (diff)
Add factorial puzzle.
-rw-r--r--puzzles/factorial.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/puzzles/factorial.py b/puzzles/factorial.py
new file mode 100644
index 0000000..f89b2ce
--- /dev/null
+++ b/puzzles/factorial.py
@@ -0,0 +1,9 @@
+name = "!"
+sort_key = 95
+
+def get_problem(self, difficulty):
+ import math
+ x = self.generate_number(difficulty)
+ question = " %s!" % (x)
+ answer = math.factorial(x)
+ return question, answer