From ea0554b59d8d9b1543a3dfc1adb805cd1ee862d8 Mon Sep 17 00:00:00 2001 From: sean-seibel Date: Mon, 27 Nov 2023 17:02:48 -0500 Subject: [PATCH 1/2] 11/21 --- exercises/labs.pl | 4 +++- exercises/resolution.pl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/labs.pl b/exercises/labs.pl index c04c84c..eb22df7 100644 --- a/exercises/labs.pl +++ b/exercises/labs.pl @@ -3,4 +3,6 @@ is_lab(shillman). takes(turing, cs307). takes(hopper, cs307). -takes(alberuni, cs220). \ No newline at end of file +takes(alberuni, cs220). + +takes_lab(S) :- takes(S, Course), meets_in(Course, Room), is_lab(Room). \ No newline at end of file diff --git a/exercises/resolution.pl b/exercises/resolution.pl index dd2ed5f..9920785 100644 --- a/exercises/resolution.pl +++ b/exercises/resolution.pl @@ -2,4 +2,4 @@ takes(jane_doe, cs254). takes(ajit_chandra, art302). takes(ajit_chandra, cs254). -classmates(X, Y) :- takes(X, Z), takes(Y, Z). \ No newline at end of file +classmates(X, Y) :- takes(X, Z), takes(Y, Z), not(X = Y). \ No newline at end of file From ded48c8ff5350d8a718faace0de7d5665824f2fd Mon Sep 17 00:00:00 2001 From: sean-seibel Date: Fri, 1 Dec 2023 16:54:55 -0500 Subject: [PATCH 2/2] 12/1 --- exercises/cmember.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exercises/cmember.pl b/exercises/cmember.pl index 17e392d..7c273e6 100644 --- a/exercises/cmember.pl +++ b/exercises/cmember.pl @@ -4,4 +4,9 @@ */ member1(X, [X | _]) :- !. -member1(X, [_ | T]) :- member1(X,T). \ No newline at end of file +member1(X, [_ | T]) :- member1(X,T). + +cmember(X, L, N) :- X > N, !, member1(X, L). +cmember(_, L, N) :- member1(N, L). + +myrepeat :- true; myrepeat.