From 757c06875f988f5bb81c3b877b22e051c95eaaa5 Mon Sep 17 00:00:00 2001 From: Michael Stone Date: Sat, 08 Jan 2011 06:14:25 +0000 Subject: Add factorial puzzle. --- 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 -- cgit v0.9.1