Skip to content

Commit

Permalink
task5 done
Browse files Browse the repository at this point in the history
  • Loading branch information
dipsywong98 committed Nov 26, 2017
1 parent f9a2e1f commit a393588
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assignment3/ass3.pl
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@
enroll_list_helper(C,[S|AS],SL):-enroll(S,CL),\+member(C,CL),enroll_list_helper(C,AS,SL),!.
enroll_list_helper(_,[],[]):-!.

enroll_list(C,SL):-all_students(ALL_S),enroll_list_helper(C,ALL_S,SL),!.
count_students(C,N):-course_list(CL),member(C,CL),enroll_list(C,L),get_length(L,N).
enroll_list(C,SL):-var(C),course_list(CL),member(C,CL),all_students(ALL_S),enroll_list_helper(C,ALL_S,SL).
enroll_list(C,SL):- \+ var(C), all_students(ALL_S),enroll_list_helper(C,ALL_S,SL),!.
count_students(C,N):-enroll_list(C,L),get_length(L,N).

0 comments on commit a393588

Please sign in to comment.