Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. %participant(Id,Age,Performance)
  2. participant(1234, 17, 'Pé coxinho').
  3. participant(3423, 21, 'Programar com os pés').
  4. participant(3788, 20, 'Sing a Bit').
  5. participant(4865, 22, 'Pontes de esparguete').
  6. participant(8937, 19, 'Pontes de pen-drives').
  7. participant(2564, 20, 'Moodle hack').
  8.  
  9. %performance(Id,Times)
  10. performance(1234,[120,120,120,120]).
  11. performance(3423,[32,120,45,120]).
  12. performance(3788,[110,2,6,43]).
  13. performance(4865,[120,120,110,120]).
  14. performance(8937,[97,101,105,110]).
  15.  
  16.  
  17. % (1)
  18.  
  19. %analyseTimeList([]):-
  20. % fail.
  21.  
  22.  
  23. %analyseTimeList([L|Ls]):-
  24. % L = 120;
  25. % analyseTimeList(Ls).
  26.  
  27.  
  28. analyseTimeList2([], Maximum, AuxMaximum):-
  29. AuxMaximum is Maximum.
  30.  
  31. analyseTimeList2([L|Ls], Maximum, AuxMaximum):-
  32. write('1st - Maximum < L'), nl,
  33. write('1st - '),
  34. write(Maximum), nl,
  35. write(L),
  36. Maximum @< L,
  37. Maximum is L,
  38. write('1st - maximum a afterwards - '),
  39. write(Maximum), nl,
  40. analyseTimeList2(Ls, Maximum, AuxMaximum).
  41.  
  42. analyseTimeList2([L|Ls], Maximum, AuxMaximum):-
  43. Maximum @>= L,
  44. analyseTimeList2(Ls, Maximum, AuxMaximum).
  45.  
  46.  
  47. %madeItThrough(Participant)
  48. madeItThrough(Participant) :-
  49. performance(Participant,Lt), %Use ID of participant to get the Time List
  50. %analyseTimeList(Lt). %Analyse Time List to know if a jury didnt hit the button
  51. analyseTimeList2(Lt, 0, Maximum),
  52. Maximum = 120.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement