summaryrefslogtreecommitdiff
path: root/prolog/problems/clp_fd/puzzle_momson_2
diff options
context:
space:
mode:
Diffstat (limited to 'prolog/problems/clp_fd/puzzle_momson_2')
-rw-r--r--prolog/problems/clp_fd/puzzle_momson_2/common.py14
-rw-r--r--prolog/problems/clp_fd/puzzle_momson_2/en.py9
2 files changed, 23 insertions, 0 deletions
diff --git a/prolog/problems/clp_fd/puzzle_momson_2/common.py b/prolog/problems/clp_fd/puzzle_momson_2/common.py
new file mode 100644
index 0000000..f96f403
--- /dev/null
+++ b/prolog/problems/clp_fd/puzzle_momson_2/common.py
@@ -0,0 +1,14 @@
+id = 152
+group = 'clp_fd'
+number = 58
+visible = True
+facts = None
+
+solution = '''\
+puzzle_momson(M, S) :-
+ M #= 10*A + B,
+ S #= 10*B + A,
+ [A,B] ins 1..9,
+ M + S #= 66,
+ M #> S,
+ labeling([], [M, S]).'''
diff --git a/prolog/problems/clp_fd/puzzle_momson_2/en.py b/prolog/problems/clp_fd/puzzle_momson_2/en.py
new file mode 100644
index 0000000..8fa8a1f
--- /dev/null
+++ b/prolog/problems/clp_fd/puzzle_momson_2/en.py
@@ -0,0 +1,9 @@
+id = 152
+name = 'puzzle_momson/2'
+slug = 'age puzzle: mom & son'
+
+description = '''\
+<p>The sum of ages of mother and her son is 66. The mother's age is the son's age reversed. How old are they?</p>
+<p>Write the predicate <code>puzzle_momson(M, S)</code> that finds the ages of mother <code>M</code> and son <code>S</code>.</p>'''
+
+hint = {}