CSC C24/324 --- Spring 2001 --- Joanis --- Project 2: Prolog Automarking Test Suite For each question, your mark was calculated as follows: score = min{0, -(value of the problem) + 2 * (test case points)} so you need at least half the test case points to get any correctness marks for a question, and, e.g., getting 9 test case points out of 12 would give you a correctness mark of 6/12 for that question. Rationale: some of the cases are trivial, and even with completely incorrect code, you could get up to half the points for the question (especially for cases which are supposed to fail). Furthermore, if your code took any more that 30 seconds to run, the script aborted for that question, and you only got the points for the cases that were passed so far. The cases were carefully selected so that in all situations, correct code would finish within a second or two. *************************************************************** Player List Test Case Expected Answer Points --------- --------------- ------ playerList(L,0) L = [] 1 playerList([joanis,jones,kiva,connamacher,fiodorov,hasek],6) yes 1 playerList([joanis,jones,kiva,connamacher,jones,hasek],6) no 1 playerList([joanis,sundin,atisari,nobody],4) no 1 playerList([joanis,jones,kiva,connamacher,sundin,atisari,joanis],7) no 1 playerList([joanis|T],5) a valid list of players 1 playerList([joanis|[atisari|T]],5) a valid list of players 1 *************************************************************** Team Roster Test Case Expected Answer Points --------- --------------- ------ % 1. Empty team not allowed teamRoster(_,0) no 1 % 2. Basic team: c l r d d g teamRoster([joanis,jones,kiva,connamacher,lowe,hasek],6) yes 1 % 3. Larger team: c d g l d r d d r l c g teamRoster([sundin,lowe,hasek,jones,fiodorov,elias,connamacher, lidstrom,kiva,edberg,motso,kolzig],12) yes 2 % 4. Another valid team: c l r d d g c l r teamRoster([joanis,jones,kiva,connamacher,fiodorov,kolzig, sundin,edberg,elias],9) yes 1 % 5. Invalid number of defenders: c l r d d d g teamRoster([joanis,jones,kiva,connamacher,lowe,lidstrom,hasek],7) no 1 % 6. No forward line: d d d d g g teamRoster([connamacher,lowe,lidstrom,fiodorov,hasek,kolzig],6) no 1 % 7. No defenders: c l r c l r g teamRoster([sundin,jones,kiva,atisari,edberg,elias,hasek],7) no 1 % 8. No goalie: c l r c l r d d teamRoster([sunding,jones,kiva,motso,edberg,alias,low,lidstrom],8) no 1 % 9. Incomplete forward line: c c l l r d d g teamRoster([joanis,sundin,jones,edberg,kiva,lowe,lidstrom,hasek],8) no 1 % 10. Complete a partial team: c l r d (needs d g) teamRoster([joanis,jones,kiva,connamacher|T],6) T has a defender and a goalie 1 % 11. Can't be completed with 6 players only: c l r g g teamRoster([joanis,jones,kiva,hasek,kolzig|_T11],6) no 1 *************************************************************** Locker Assigment Test Case Expected Answer Points --------- --------------- ------ % 1. Empty list lockerAssignment([],N) N=0 1 % 2. Length 0 lockerAssignment(L,0) L=[] 1 % 3. One player lockerAssignment([jones],1) yes 1 % 4. Two players -- different positions: c l lockerAssignment([joanis,jones],2) yes 1 % 5. Three players, correct assignment: c l c lockerAssignment([joanis,jones,sundin],3) yes 1 % 6. Full team, correct assignment: d g c l r d lockerAssignment([connamacher,hasek,joanis,jones,kiva,lowe],6) yes 2 % 7. Wrong: c c l r lockerAssignment([sundin,atisari,jones,kiva],4) no 1 % 8. Wrong: c l r r lockerAssignment([sundin,jones,kiva,elias],4) no 1 % 9. Wrong: c l l r lockerAssignment([joanis,jones,edberg,kiva],4) no 1 % 10. Complete correctly: c l c ? lockerAssignment([joanis,jones,sundin|T],4) T has one player--not a center 1 % 11. Can't be completed: c c ? ? lockerAssignment([joanis,sundin|_T11],4) no 1 *************************************************************** Banquet Talk Test Case Expected Answer Points --------- --------------- ------ % 1. A = B = C != D = E banquetTalk([joanis,jones,kiva,hasek,lowe],5) yes 2 % 2. A = B != C = D = E banquetTalk([joanis,jones,sundin,edberg,kiva],5) yes 2 % 3. A = B != C = D != E = F banquetTalk([joanis,krueger,hasek,lowe,edberg,selanne],6) yes 2 % 4. A = B != C != D = E banquetTalk([joanis,krueger,lowe,edberg,selanne],5) no 1 % 5. A != B = C = D = E banquetTalk([lowe,jones,kiva,selanne,krueger],5) no 1 % 6. A = B = C = D != E banquetTalk([jones,kiva,selanne,krueger,lowe],5) no 1 % 7. A != B ... banquetTalk([joanis|[atisari|_T]],5) no 1 % 8. A = B = C = D = ? banquetTalk([joanis|[jones|[kiva|[connamacher|T]]]],5) T has a player with a language in common with Connamacher 1 % 9. L, N as variables banquetTalk(L,N) any valid answer 1 *************************************************************** Common Background Test Case Expected Answer Points --------- --------------- ------ commonBackground(L,0) L = [] 1 commonBackground([],N) N = 0 1 commonBackground([joanis,jones,kiva,hasek,lowe],5) no 1 commonBackground([sundin,lidstrom,joanis,edberg],4) no 1 commonBackground([sundin,lidstrom,edberg],3) yes 1 commonBackground(L,5) any valid answer 1 commonBackground([joanis,sundin,edberg,connamacher,lidstrom],5) yes 2 commonBackground(L,N) L = [], N = 0 1 (but not necessarily as first answer) commonBackground([joanis|[atisari|[motso|[connamacher|_T]]]],5) no 1 commonBackground([joanis|[atisari|_T]],5) no 2