aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-279/2colours/prolog/ch-1.p1
-rw-r--r--challenge-279/2colours/prolog/ch-2.p1
2 files changed, 2 insertions, 0 deletions
diff --git a/challenge-279/2colours/prolog/ch-1.p b/challenge-279/2colours/prolog/ch-1.p
new file mode 100644
index 0000000000..b371649c37
--- /dev/null
+++ b/challenge-279/2colours/prolog/ch-1.p
@@ -0,0 +1 @@
+task1(Letters, Weights, Word) :- maplist([E1, E2, E1-E2]>>true, Letters, Weights, Weighted_Letters), sort(2, @<, Weighted_Letters, Sorted_Pairs), pairs_keys(Sorted_Pairs, Sorted_Letters), string_chars(Word, Sorted_Letters).
diff --git a/challenge-279/2colours/prolog/ch-2.p b/challenge-279/2colours/prolog/ch-2.p
new file mode 100644
index 0000000000..6adf7674d2
--- /dev/null
+++ b/challenge-279/2colours/prolog/ch-2.p
@@ -0,0 +1 @@
+task2(Str) :- re_replace("[^aeiou]"/ig, "", Str, Vowels_Only), string_length(Vowels_Only, Vowel_Count), Vowel_Count mod 2 =:= 0.