From 95e2fe57f6e4639f6ae9f1fef368829d5090dbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Tue, 18 Aug 2015 16:06:19 +0200 Subject: Exported all problems from the SQLite database into the new directory structure. --- prolog/problems/license_plates/joindigits_2/common.py | 14 ++++++++++++++ prolog/problems/license_plates/joindigits_2/en.py | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 prolog/problems/license_plates/joindigits_2/common.py create mode 100644 prolog/problems/license_plates/joindigits_2/en.py (limited to 'prolog/problems/license_plates/joindigits_2') diff --git a/prolog/problems/license_plates/joindigits_2/common.py b/prolog/problems/license_plates/joindigits_2/common.py new file mode 100644 index 0000000..dc3e4a5 --- /dev/null +++ b/prolog/problems/license_plates/joindigits_2/common.py @@ -0,0 +1,14 @@ +id = 145 +group = 'license_plates' +number = 52 +visible = True +facts = None + +solution = '''\ +joindigits([X], [X]). +joindigits([X,Y|T], NT) :- + XY is 10*X + Y, + joindigits([XY|T], NT). +joindigits([X,Y|T], [X|NT]) :- + joindigits([Y|T], NT). +''' diff --git a/prolog/problems/license_plates/joindigits_2/en.py b/prolog/problems/license_plates/joindigits_2/en.py new file mode 100644 index 0000000..19623d7 --- /dev/null +++ b/prolog/problems/license_plates/joindigits_2/en.py @@ -0,0 +1,15 @@ +id = 145 +name = 'joindigits/2' +slug = 'join adjacent numbers in a list' + +description = '''\ +

joindigits(L, NL): the list NL is obtained from L by arbitrarily joining neighboring digits. Your code should generate all valid solutions.

+
+  ?- joindigits([3,2,4], NL).
+    NL = [324] ;
+    NL = [32,4] ;
+    NL = [3,24] ;
+    NL = [3,2,4].
+
''' + +hint = {} -- cgit v1.2.1