{"commit":"fbe85971cba3e4ad45aa9312eee266e224376683","subject":"Dzia\u0142a?","message":"Dzia\u0142a?\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"start(Listawej,[Ruch1]):-\n\tH is 3,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 2,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 1,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 0,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\n\nnth0(Id, Lista, Value):-\nnth01(0,Lista,Value, Id).\n\nnth01(Iter, [H|T], H, Iter).\n\nnth01(Iter, [H|T], Value, Id):-\nIter1 is Iter +1,\nnth01(Iter1, T, Value, Id).\n\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","old_contents":"start(Listawej,[Ruch1]):-\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),\n\tnot(wiecejZbitych(Listawej,Listawyj,H)),!.\n\nwiecejZbitych(Listawej,Listawyj,H):-\n\tbegin(Listawej,[H2|Ruch2],[Hb|Finb]),\n\tHb > H.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\n\nnth0(Id, Lista, Value):-\nnth01(0,Lista,Value, Id).\n\nnth01(Iter, [H|T], H, Iter).\n\nnth01(Iter, [H|T], Value, Id):-\nIter1 is Iter +1,\nnth01(Iter1, T, Value, Id).\n\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"bc87d50d0df55b0ab25a32c200e6f4556f7d649c","subject":"MONDRY JAGUAR","message":"MONDRY JAGUAR\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"start(Listawej,[Ruch1]):-\n\tH is 3,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 2,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 1,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 0,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\n\nnth0(Id, Lista, Value):-\nnth01(0,Lista,Value, Id).\n\nnth01(Iter, [H|T], H, Iter).\n\nnth01(Iter, [H|T], Value, Id):-\nIter1 is Iter +1,\nnth01(Iter1, T, Value, Id).\n\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","old_contents":"start(Listawej,[Ruch1]):-\n\tH is 3,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 2,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 1,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\nstart(Listawej,[Ruch1]):-\n\tH is 0,\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),!.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\n\nnth0(Id, Lista, Value):-\nnth01(0,Lista,Value, Id).\n\nnth01(Iter, [H|T], H, Iter).\n\nnth01(Iter, [H|T], Value, Id):-\nIter1 is Iter +1,\nnth01(Iter1, T, Value, Id).\n\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"0eab33813d6edde46ae660c25e541ff50cb3fb19","subject":"[Prolog] Logika planszy","message":"[Prolog] Logika planszy\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(1,0,0,0,0,1,0,1,1).\ntokenMove(2,0,0,0,1,1,0,1,0).\ntokenMove(3,0,0,0,1,1,1,1,1).\ntokenMove(4,0,0,0,1,1,0,1,0).\ntokenMove(5,0,0,0,1,0,1,1,0).\n\ntokenMove(6,0,1,0,0,1,0,1,0).\ntokenMove(7,1,1,1,1,1,1,1,1).\ntokenMove(8,0,1,0,1,1,0,1,0).\ntokenMove(9,1,1,1,1,1,1,1,1).\ntokenMove(10,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(11,0,1,1,0,1,0,1,1).\ntokenMove(12,0,1,0,1,1,0,1,0).\ntokenMove(13,1,1,1,1,1,1,1,1).\ntokenMove(14,0,1,0,1,1,0,1,0).\ntokenMove(15,1,1,0,1,0,1,1,0).\n\ntokenMove(16,0,1,0,0,1,0,1,0).\ntokenMove(17,1,1,1,1,1,1,1,1).\ntokenMove(18,0,1,0,1,1,0,1,0).\ntokenMove(19,1,1,1,1,1,1,1,1).\ntokenMove(20,0,1,0,1,0,0,1,0).\n\ntokenMove(21,0,1,1,0,1,0,0,0).\ntokenMove(22,0,1,0,1,1,0,0,0).\ntokenMove(23,1,1,1,1,1,1,1,1).\ntokenMove(24,0,1,0,1,1,0,0,0).\ntokenMove(25,1,1,0,1,0,0,0,0).\n\ntokenMove(26,0,0,0,0,0,0,0,0).\ntokenMove(27,0,0,1,0,1,1,0,1).\ntokenMove(28,0,1,0,1,1,0,1,0).\ntokenMove(29,1,0,0,1,0,1,0,1).\ntokenMove(30,0,0,0,0,0,0,0,0).\n\ntokenMove(31,0,0,1,0,0,0,0,0).\ntokenMove(32,0,0,0,0,0,0,0,0).\ntokenMove(33,0,1,0,0,0,0,0,0).\ntokenMove(34,0,0,0,0,0,0,0,0).\ntokenMove(35,1,0,0,0,0,0,0,0).\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max\n\n\nindexOf([Element|_], Element, 0). % We found the element\nindexOf([_|Tail], Element, Index):-\n indexOf(Tail, Element, Index1), % Check in the tail of the list\n Index is Index1+1. % and increment the resulting index\n\n % A AA AAA AAAA AAAAA\n % B BB BBB BBBB BBBBB\n % C CC CCC CCCC CCCCC\n % D DD DDD DDDD DDDDD\n % E EE EEE EEEE EEEEE\n % GG GGG GGGG\n % H HH HHH HHHH HHHHH\n\n tokenMove(1,0,0,0,1,1,1,0,0,0)\nabilityToMove( [wejscie|_] , IndexEl , [] ):-\n\ttokemMove(A,1,1,1,1,1,1,1,1):-\n\t\tisEqual(A,7),\n\t\tisEqual(A,9),\n","old_contents":"minimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max\n\n\nindexOf([Element|_], Element, 0). % We found the element\nindexOf([_|Tail], Element, Index):-\n indexOf(Tail, Element, Index1), % Check in the tail of the list\n Index is Index1+1. % and increment the resulting index\n\n % A AA AAA AAAA AAAAA\n % B BB BBB BBBB BBBBB\n % C CC CCC CCCC CCCCC\n % D DD DDD DDDD DDDDD\n % E EE EEE EEEE EEEEE\n % GG GGG GGGG\n % H HH HHH HHHH HHHHH\n\n tokenMove(1,0,0,0,1,1,1,0,0,0)\nabilityToMove( [wejscie|_] , IndexEl , [] ):-\n\ttokemMove(A,1,1,1,1,1,1,1,1):-\n\t\tisEqual(A,7),\n\t\tisEqual(A,9),\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"9f68de93dc6641fad960c9aed40c353ce2b71762","subject":"Kasuj\u0119 ilo\u015b\u0107 skasowanych","message":"Kasuj\u0119 ilo\u015b\u0107 skasowanych\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"start(Listawej,[Ruch1]):-\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),\n\tnot(wiecejZbitych(Listawej,Listawyj,H)),!.\n\nwiecejZbitych(Listawej,Listawyj,H):-\n\tbegin(Listawej,[H2|Ruch2],[Hb|Finb]),\n\tHb > H.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","old_contents":"start(Listawej,[H|Ruch1]):-\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),\n\tnot(wiecejZbitych(Listawej,Listawyj,H)),!.\n\nwiecejZbitych(Listawej,Listawyj,H):-\n\tbegin(Listawej,[H2|Ruch2],[Hb|Finb]),\n\tHb > H.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"1e421c537a7a991e020374263f603868be3f327a","subject":"Update taskdb1.prolog","message":"Update taskdb1.prolog","repos":"lsoriano808\/Functional,lsoriano808\/Functional,lsoriano808\/Functional","old_file":"a1\/taskdb1.prolog","new_file":"a1\/taskdb1.prolog","new_contents":"% Author: Landon Soriano\n% Date: 02\/02\/2015\n\n%%\n%% person(ID, TASK_CAPABILITIES, AVAILABLE_HOURS)\n%%\n%% How many hours each person has available and what classes of\ntasks they\n%% are capable of performing.\n%%\nperson(p1, [c,a], 20).\nperson(p2, [b], 10).\nperson(p3, [a,b], 15).\nperson(p4, [c], 30).\n%%\n%% task(ID, REQUIRED_HOURS, TASK_CLASS)\n%%\n%% How long each task requires and what class it falls under.\n%%\ntask(t1, a, 5).\ntask(t2, b, 10).\ntask(t3, c, 15).\ntask(t4, c, 10).\ntask(t5, a, 15).\ntask(t6, b, 10).\n","old_contents":"% Author: Landon Soriano\n% Date: 02\/02\/2015\n% Class: ICS 313\n\n%%\n%% person(ID, TASK_CAPABILITIES, AVAILABLE_HOURS)\n%%\n%% How many hours each person has available and what classes of\ntasks they\n%% are capable of performing.\n%%\nperson(p1, [c,a], 20).\nperson(p2, [b], 10).\nperson(p3, [a,b], 15).\nperson(p4, [c], 30).\n%%\n%% task(ID, REQUIRED_HOURS, TASK_CLASS)\n%%\n%% How long each task requires and what class it falls under.\n%%\ntask(t1, a, 5).\ntask(t2, b, 10).\ntask(t3, c, 15).\ntask(t4, c, 10).\ntask(t5, a, 15).\ntask(t6, b, 10).\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"261b23b9619effad02e5aacea535686e33e5d2b1","subject":"Eliminar .yap","message":"Eliminar .yap\n\n","repos":"inakidml\/Proyecto_conectores_Acceso_Datos","old_file":"Baloncesto\/DBBaloncesto.yap","new_file":"Baloncesto\/DBBaloncesto.yap","new_contents":"","old_contents":"db4o\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0013\u0002\u0000\u0000\u0000\u0000\u0000\u00009\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0014\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0017\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'\u0000\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0000\u0000\u0003\"\u0000\u0000\u00001\u0000\u0000\u000f\u0000\u0000\u0000D\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0000\u0000\u0003\"\u0000\u0000\u00001\u0000\u0000\u000f\u0000\u0000\u0000D\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0000\u0000\u0003\"\u0000\u0000\u00001\u0000\u0000\u000f\u0000\u0000\u0000D\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tY\u0000\u0000\u0003\"\u0000\u0000\u00001\u0000\u0000\u000f\u0000\u0000\u0000D\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000.\n\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u001e\u0000\u0000\u0000(\u0000\u0000\u0001_\u0016_;\u0000\u0000\u0000\u0006\u0001\u0000\u0000\u0000\u001fDESKTOP-3C6IGJV15f16eb5f3b0457c\u0000\u0000\u0000\u0019c\u0000o\u0000m\u0000.\u0000d\u0000b\u00004\u0000o\u0000.\u0000e\u0000x\u0000t\u0000.\u0000D\u0000b\u00004\u0000o\u0000D\u0000a\u0000t\u0000a\u0000b\u0000a\u0000s\u0000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u000bi\u0000_\u0000s\u0000i\u0000g\u0000n\u0000a\u0000t\u0000u\u0000r\u0000e\u0000\u0000\u0000\u0000\u0006\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0006i\u0000_\u0000u\u0000u\u0000i\u0000d\u0000\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00001\u0000\u0000\u00002\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000(\u0000\u0000\u0000\u0001\u0000\u0000\u0000$\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f\n\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u00006\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u00006\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000.\u0000\u0000\u0000\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u001d\u0000\u0000\u0000\u0010\u0001\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u000f\u0000\u0000\u0007\u0012\u0000\u0000\u00005\u0000\u0000\u0000\u0010\u0000\u0000\u0003\u0005\u0000\u0000\u0000\r\u0000\u0000\u0000\u0011\u0000\u0000\u0003\u0012\u0000\u0000\u0000\u0010\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000!\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'\u0000\u0000\u0000\u0000\u0014c\u0000o\u0000m\u0000.\u0000d\u0000b\u00004\u0000o\u0000.\u0000S\u0000t\u0000a\u0000t\u0000i\u0000c\u0000F\u0000i\u0000e\u0000l\u0000d\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u0004n\u0000a\u0000m\u0000e\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0005v\u0000a\u0000l\u0000u\u0000e\u0000\u0000\u0000\u0000\u000b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001e\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0019\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000+\u0000\u0000\u0000,\u0000\u0000\u0000-\u0000\u0000\u0000\u0000\u0000\u0014c\u0000o\u0000m\u0000.\u0000d\u0000b\u00004\u0000o\u0000.\u0000S\u0000t\u0000a\u0000t\u0000i\u0000c\u0000C\u0000l\u0000a\u0000s\u0000s\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0018\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u0004n\u0000a\u0000m\u0000e\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0006f\u0000i\u0000e\u0000l\u0000d\u0000s\u0000\u0000\u0000\u0000\u0016\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u000f\u0000\u0000\u0007\u0012\u0000\u0000\u00005\u0000\u0000\u0000\u0010\u0000\u0000\u0003\u0005\u0000\u0000\u0000\r\u0000\u0000\u0000\u0011\u0000\u0000\u0003\u0012\u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0013j\u0000a\u0000v\u0000a\u0000.\u0000u\u0000t\u0000i\u0000l\u0000.\u0000A\u0000r\u0000r\u0000a\u0000y\u0000L\u0000i\u0000s\u0000t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000#\u0000\u0000\u0000%\u0000\u0000\u0000\u0001\u0003\u0000\u0000\u0000-c\u0000o\u0000m\u0000.\u0000d\u0000b\u00004\u0000o\u0000.\u0000t\u0000y\u0000p\u0000e\u0000h\u0000a\u0000n\u0000d\u0000l\u0000e\u0000r\u0000s\u0000.\u0000I\u0000g\u0000n\u0000o\u0000r\u0000e\u0000F\u0000i\u0000e\u0000l\u0000d\u0000s\u0000T\u0000y\u0000p\u0000e\u0000H\u0000a\u0000n\u0000d\u0000l\u0000e\u0000r\u0000l\u0000e\u0000r\u0000d\u0000l\u0000e\u0000r\u0000\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000$\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0010\u0000\u0000\u00003\u0000\u0000\u0000\u0000\u0000#\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0018b\u0000a\u0000l\u0000o\u0000n\u0000c\u0000e\u0000s\u0000t\u0000o\u0000.\u0000m\u0000o\u0000d\u0000e\u0000l\u0000o\u0000.\u0000E\u0000q\u0000u\u0000i\u0000p\u0000o\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u001b\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0002i\u0000d\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0006n\u0000o\u0000m\u0000b\u0000r\u0000e\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\fa\u0000n\u0000o\u0000F\u0000u\u0000n\u0000d\u0000a\u0000c\u0000i\u0000o\u0000n\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\np\u0000r\u0000e\u0000s\u0000i\u0000d\u0000e\u0000n\u0000t\u0000e\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\bp\u0000a\u0000b\u0000e\u0000l\u0000l\u0000o\u0000n\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\fp\u0000a\u0000t\u0000r\u0000o\u0000c\u0000i\u0000n\u0000a\u0000d\u0000o\u0000r\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\tj\u0000u\u0000g\u0000a\u0000d\u0000o\u0000r\u0000e\u0000s\u0000\u0000\u0000\u0000\u000b\u0000\u0000\u0000\u0000\u0000\n\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0001\u0000\u0000\u0000R\u0000\u0000\u0000\u0016\u0000\u0000\u0000\"\u0000\u0000\u00000\u0000\u0000\u0000\u0016S\u0000e\u0000 \u0000p\u0000r\u0000a\u0000c\u0000t\u0000i\u0000c\u0000a\u0000 \u0000l\u0000a\u0000 \u0000d\u0000e\u0000f\u0000e\u0000n\u0000s\u0000a\u0000\u0000\u0000\u0000\tD\u0000e\u0000f\u0000e\u0000n\u0000s\u0000i\u0000v\u0000o\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\r\u0000\u0000\u0001\u0000\u0000\u0000\u0010\u0000\u0000\to\u0000\u0000\u0000 \u0000\u0000\u0000\u0011\u0000\u0000\u0005l\u0000\u0000\u0000\"\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0010\u0000\u0000\u00002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000+\u0000\u0000\u0000,\u0000\u0001\u001c\u0000\u0000\u0000\u0016j\u0000a\u0000v\u0000a\u0000.\u0000u\u0000t\u0000i\u0000l\u0000.\u0000A\u0000b\u0000s\u0000t\u0000r\u0000a\u0000c\u0000t\u0000L\u0000i\u0000s\u0000t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0000\u0000\u0000\"\u0000\u0000\u0000\u0001\u0003\u0000\u0000\u0000-c\u0000o\u0000m\u0000.\u0000d\u0000b\u00004\u0000o\u0000.\u0000t\u0000y\u0000p\u0000e\u0000h\u0000a\u0000n\u0000d\u0000l\u0000e\u0000r\u0000s\u0000.\u0000I\u0000g\u0000n\u0000o\u0000r\u0000e\u0000F\u0000i\u0000e\u0000l\u0000d\u0000s\u0000T\u0000y\u0000p\u0000e\u0000H\u0000a\u0000n\u0000d\u0000l\u0000e\u0000r\u0000d\u0000l\u0000e\u0000r\u0000\u0000\u0000\u0000\u001cj\u0000a\u0000v\u0000a\u0000.\u0000u\u0000t\u0000i\u0000l\u0000.\u0000A\u0000b\u0000s\u0000t\u0000r\u0000a\u0000c\u0000t\u0000C\u0000o\u0000l\u0000l\u0000e\u0000c\u0000t\u0000i\u0000o\u0000n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u001f\u0000\u0000\u0000\u0001\u0003\u0000\u0000\u0000+c\u0000o\u0000m\u0000.\u0000d\u0000b\u00004\u0000o\u0000.\u0000t\u0000y\u0000p\u0000e\u0000h\u0000a\u0000n\u0000d\u0000l\u0000e\u0000r\u0000s\u0000.\u0000C\u0000o\u0000l\u0000l\u0000e\u0000c\u0000t\u0000i\u0000o\u0000n\u0000T\u0000y\u0000p\u0000e\u0000H\u0000a\u0000n\u0000d\u0000l\u0000e\u0000r\u0000\n\u0000\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001c\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000\u0000 \u0000\u0000\u0000X\u0000\u0000\u0000*\u0000\u0000\u0000B\u0000\u0000\u0000\u0016\u0000\u0000\u0000:\u0000\u0000\u0000&\u0000\u0000\u0000'\u0000\u0000\u0000\tH\u0000e\u0000r\u0000b\u0000a\u0000l\u0000i\u0000f\u0000e\u0000\u0000\u0000\u0000\u0013\t\u0000G\u0000r\u0000a\u0000n\u0000 \u0000C\u0000a\u0000n\u0000a\u0000r\u0000i\u0000a\u0000 \u0000A\u0000r\u0000e\u0000n\u0000a\u0000\u0000\u0000\u0000\u000eE\u0000n\u0000r\u0000i\u0000q\u0000u\u0000e\u0000 \u0000M\u0000o\u0000r\u0000e\u0000n\u0000o\u0000\u0000\u0000\u0000\fG\u0000r\u0000a\u0000n\u0000 \u0000C\u0000a\u0000n\u0000a\u0000r\u0000i\u0000a\u0000\u0001\u0000\u0000\u0000%\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0000\u0000\u0000\u0000\u00001\u0000\u0000 \u0000\u0000\u0000#\u0000\u0000\u0000&\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001a\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'\u0000\u0000\u0000\t\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0016\u0000\u0000\u0000\u0019\u0000\u0000\u0000\u001c\u0000\u0000\u0000 \u0000\u0000\u0000#\u0000\u0000\u0000&\u0000\u0000\u0000*\u0000\u0000\u00000\u0001\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000.\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00001\u0000\u0000\u00002\u0000\u0000\u0000\u0000\u0000\u0000 b\u0000a\u0000l\u0000o\u0000n\u0000c\u0000e\u0000s\u0000t\u0000o\u0000.\u0000m\u0000o\u0000d\u0000e\u0000l\u0000o\u0000.\u0000T\u0000i\u0000p\u0000o\u0000I\u0000n\u0000c\u0000i\u0000d\u0000e\u0000n\u0000c\u0000i\u0000a\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\/\u0000\u0000\u0000\u0004\u0001\u0000\u0000\u0000\u0002i\u0000d\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004t\u0000i\u0000p\u0000o\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0007s\u0000a\u0000n\u0000c\u0000i\u0000o\u0000n\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u000bd\u0000e\u0000s\u0000c\u0000r\u0000i\u0000p\u0000c\u0000i\u0000o\u0000n\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0010\u0000\u0000\u0001\u0000\u0000\u0000\u0010\u0000\u0000\u0002\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u0011\u0000\u0000\u0007G\u0000\u0000\u0000\u001c\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000R\u0000\u0000\u0000\u0012\u0000\u0000\u0000F\u0000\u0000\u0000\f\u0000\u0000\u0000*\u0000\u0000\u0000\u001c\u0000\u0000\u0000\fL\u0000l\u0000e\u0000g\u0000a\u0000r\u0000 \u0000t\u0000a\u0000r\u0000d\u0000e\u0000\u0000\u0000\u0000\u00041\u00000\u00000\u00000\u0000\u0000\u0000\u0000\u0007R\u0000e\u0000t\u0000r\u0000a\u0000s\u0000o\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000#b\u0000a\u0000l\u0000o\u0000n\u0000c\u0000e\u0000s\u0000t\u0000o\u0000.\u0000m\u0000o\u0000d\u0000e\u0000l\u0000o\u0000.\u0000T\u0000i\u0000p\u0000o\u0000E\u0000n\u0000t\u0000r\u0000e\u0000n\u0000a\u0000m\u0000i\u0000e\u0000n\u0000t\u0000o\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000)\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0002i\u0000d\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004t\u0000i\u0000p\u0000o\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u000bd\u0000e\u0000s\u0000c\u0000r\u0000i\u0000p\u0000c\u0000i\u0000o\u0000n\u0000\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\n\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0002\u0000\u0000\u0000P\u0000\u0000\u0000\u0014\u0000\u0000\u0000\"\u0000\u0000\u0000.\u0000\u0000\u0000\u0015S\u0000e\u0000 \u0000p\u0000r\u0000a\u0000c\u0000t\u0000i\u0000c\u0000a\u0000 \u0000l\u0000a\u0000 \u0000o\u0000f\u0000e\u0000n\u0000s\u0000a\u0000\u0000\u0000\u0000\bO\u0000f\u0000e\u0000n\u0000s\u0000i\u0000v\u0000o\u0000\n\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0003\u0000\u0000\u0000<\u0000\u0000\u0000\u0016\u0000\u0000\u0000\"\u0000\u0000\u0000\u001a\u0000\u0000\u0000\u000bP\u0000a\u0000r\u0000a\u0000 \u0000c\u0000a\u0000n\u0000s\u0000a\u0000r\u0000\u0000\u0000\u0000\tE\u0000x\u0000p\u0000l\u0000o\u0000s\u0000i\u0000v\u0000o\u0000\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000~\u0000\u0000\u0000\u0014\u0000\u0000\u0000t\u0000\u0000\u0000\n\u0000\u0000\u0000*\u0000\u0000\u0000J\u0000\u0000\u0000#I\u0000n\u0000s\u0000u\u0000l\u0000t\u0000a\u0000r\u0000 \u0000a\u0000l\u0000 \u0000j\u0000e\u0000f\u0000e\u0000 \u0000o\u0000 \u0000a\u0000 \u0000l\u0000o\u0000s\u0000 \u0000c\u0000o\u0000m\u0000p\u0000a\u0000\u0000e\u0000r\u0000o\u0000s\u0000\u0000\u0000\u0000\u00035\u00000\u00000\u0000\u0000\u0000\u0000\bI\u0000n\u0000s\u0000u\u0000l\u0000t\u0000a\u0000r\u0000\n\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000n\u0000\u0000\u0000\u000e\u0000\u0000\u0000`\u0000\u0000\u0000\u000e\u0000\u0000\u0000*\u0000\u0000\u00006\u0000\u0000\u0000\u0019N\u0000o\u0000 \u0000v\u0000e\u0000n\u0000i\u0000r\u0000 \u0000a\u0000l\u0000 \u0000e\u0000n\u0000t\u0000r\u0000e\u0000n\u0000a\u0000m\u0000i\u0000e\u0000n\u0000t\u0000o\u0000\u0000\u0000\u0000\u00051\u00000\u00000\u00000\u00000\u0000\u0000\u0000\u0000\u0005F\u0000a\u0000l\u0000t\u0000a\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0002^\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u0010\u0000\u0000\u0001n\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0011\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000\u0000\u0001\u0000\u0000\u0000F\u0000\u0000\u0000\u0013\u0000\u0000\t\u0000\u0000\u0000(\u0000\u0000\u0000\u0014\u0000\u0000\u0000.\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0015\u0000\u0000\u0000?\u0000\u0000\u0000\r\u0000\u0000\u0000\u0016\u0000\u0000\u0003v\u0000\u0000\u0000j\u0000\u0000\u0000\u0017\u0000\u0000\u0000L\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0018\u0000\u0000\u0000]\u0000\u0000\u0000\r\u0000\u0000\u0000\u0019\u0000\u0000\u0004\u001c\u0000\u0000\u0000l\u0000\u0000\u0000\u001a\u0000\u0000\u0002\u0000\u0000\u0000\u001a\u0000\u0000\u0000\u001b\u0000\u0000\t\u0000\u0000\u0000\r\u0000\u0000\u0000\u001c\u0000\u0000\u0005\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u001d\u0000\u0000\b\u0000\u0000\u0000\u0000\u0000\u0000\u001e\u0000\u0000\t\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u001f\u0000\u0000\u0003\u0000\u0000\u0000\u001d\u0000\u0000\u0000 \u0000\u0000\b\n\u0000\u0000\u0000\u0000\u0000\u0000!\u0000\u0000\u0000j\u0000\u0000\u0000 \u0000\u0000\u0000\"\u0000\u0000\u0003S\u0000\u0000\u0000\r\u0000\u0000\u0000#\u0000\u0000\u0007c\u0000\u0000\u0000\u0000\u0000\u0000$\u0000\u0000\u0003`\u0000\u0000\u0000\u0016\u0000\u0000\u0000%\u0000\u0000\u0005_\u0000\u0000\u0000\r\u0000\u0000\u0000&\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000'\u0000\u0000\u0002\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0003\u0000\u0000\u0000\u001f\u0000\u0000\u0000)\u0000\u0000\u0002\u0000\u0000\u0000\u0010\u0000\u0000\u0000*\u0000\u0000\u000b_\u0000\u0000\u0000\u0000\u0000\u0000+\u0000\u0000\u0006\u0000\u0000\u0000h\u0000\u0000\u0000,\u0000\u0000\f\u0005\u0000\u0000\u0000d\u0000\u0000\u0000-\u0000\u0000\fi\u0000\u0000\u0000R\u0000\u0000\u0000.\u0000\u0000\u0002s\u0000\u0000\u0000\u001d\u0000\u0000\u0000\/\u0000\u0000\t\u0000\u0000\u0000\u0010\u0000\u0000\u00000\u0000\u0000\n\u0005\u0000\u0000\u0000\u0000\u0000\u00001\u0000\u0000\n\u0000\u0000\u0000i\u0000\u0000\u00002\u0000\u0000\f\u0000\u0000\u0000\u0000\u0000\u00003\u0000\u0000\rM\u0000\u0000\u0000|\u0000\u0000\u0000\b\u0000\u0000\u0000\b\u0000\u0000\u0002V\u0000\u0000\u0000\r\u0000\u0000\u0001\u0000\u0000\u0000\u0015\u0000\u0000\u0002\u0000\u0000\u0000\u001c\u0000\u0000\u0007G\u0000\u0000\u0000\u001c\u0000\u0000\t\u0000\u0000\u00000\u0000\u0000\u0004\u0000\u0000\u00005\u0000\u0000\n\u0000\u0000\u0002\u0000\u0000\u000f\u0000\u0000\u0002V\u0000\u0000\u0000\r\u0000\u0000\u0001\u0000\u0000\u0000\u0015\u0000\u0000\u0002\u0000\u0000\u0000\u001c\u0000\u0000\u0007G\u0000\u0000\u0000\u001c\u0000\u0000\t\u0000\u0000\u00000\u0000\u0000\u0004\u0000\u0000\u00001\u0000\u0000\u0003\"\u0000\u0000\u00005\u0000\u0000\n\u0000\u0000\u0002C\u0000\u0000\u0010\u001e\u0000\u0000\u0011\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u000f\u0000\u0000\n\u0000\u0000\u00005\u0000\u0000\u0000\u0010\u0000\u0000\u0003\u0005\u0000\u0000\u0000\r\u0000\u0000\u0000\u0011\u0000\u0000\u0003\u0012\u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0003\u0000\u0000\u0000\u001f\u0000\u0000\u0000)\u0000\u0000\u0002\u0000\u0000\u0000\u0010\u0000\u0000\u0000*\u0000\u0000\u000b_\u0000\u0000\u0000\u0000\u0000\u0000+\u0000\u0000\u0006\u0000\u0000\u0000h\u0000\u0000\u0000,\u0000\u0000\f\u0005\u0000\u0000\u0000d\u0000\u0000\u0000-\u0000\u0000\fi\u0000\u0000\u0000R\u0000\u0000\u0000$\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000f\u0000\u0000\u0002^\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u0010\u0000\u0000\u0001n\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0011\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0012\u0000\u0000\u0001\u0000\u0000\u0000F\u0000\u0000\u0000\u0013\u0000\u0000\t\u0000\u0000\u0000(\u0000\u0000\u0000\u0014\u0000\u0000\u0000.\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0015\u0000\u0000\u0000?\u0000\u0000\u0000\r\u0000\u0000\u0000\u0016\u0000\u0000\u0003v\u0000\u0000\u0000j\u0000\u0000\u0000\u0017\u0000\u0000\u0000L\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0018\u0000\u0000\u0000]\u0000\u0000\u0000\r\u0000\u0000\u0000\u0019\u0000\u0000\u0004\u001c\u0000\u0000\u0000l\u0000\u0000\u0000\u001a\u0000\u0000\u0002\u0000\u0000\u0000\u001a\u0000\u0000\u0000\u001b\u0000\u0000\t\u0000\u0000\u0000\r\u0000\u0000\u0000\u001c\u0000\u0000\u0005\u0000\u0000\u0001\u001c\u0000\u0000\u0000\u001d\u0000\u0000\b\u0000\u0000\u0000\u0000\u0000\u0000\u001e\u0000\u0000\t\u0000\u0000\u0000\u0015\u0000\u0000\u0000\u001f\u0000\u0000\u0003\u0000\u0000\u0000\u001d\u0000\u0000\u0000 \u0000\u0000\b\n\u0000\u0000\u0000\u0000\u0000\u0000!\u0000\u0000\u0000j\u0000\u0000\u0000 \u0000\u0000\u0000\"\u0000\u0000\u0003S\u0000\u0000\u0000\r\u0000\u0000\u0000#\u0000\u0000\u0007c\u0000\u0000\u0000\u0000\u0000\u0000$\u0000\u0000\u0003`\u0000\u0000\u0000\u0016\u0000\u0000\u0000%\u0000\u0000\u0005_\u0000\u0000\u0000\r\u0000\u0000\u0000&\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000'\u0000\u0000\u0002\u0000\u0000\u00006\u0000\u0000\u0000(\u0000\u0000\u0003\u0000\u0000\u0000\u001f\u0000\u0000\u0000)\u0000\u0000\u0002\u0000\u0000\u0000\u0010\u0000\u0000\u0000*\u0000\u0000\u000b_\u0000\u0000\u0000\u0000\u0000\u0000+\u0000\u0000\u0006\u0000\u0000\u0000h\u0000\u0000\u0000,\u0000\u0000\f\u0005\u0000\u0000\u0000d\u0000\u0000\u0000-\u0000\u0000\fi\u0000\u0000\u0000R\u0000\u0000\u0000.\u0000\u0000\t\u0000\u0000\u0000\u001c\u0000\u0000\u0000\/\u0000\u0000\u0001\u0000\u0000\u0000\r\u0000\u0000\u00000\u0000\u0000\n\u0005\u0000\u0000\u0000\u0000\u0000\u00001\u0000\u0000\n\u0000\u0000\u0000i\u0000\u0000\u00002\u0000\u0000\f\u0000\u0000\u0000","returncode":0,"stderr":"","license":"apache-2.0","lang":"Prolog"} {"commit":"d4b5e9893566f2af85b8d0fe7c1c06ce60e20a3f","subject":"Update geometry.prolog","message":"Update geometry.prolog\n\nNoticed usage of gradients over radians values","repos":"AresAndy\/Prolog-examples","old_file":"geometry.prolog","new_file":"geometry.prolog","new_contents":"\/** Basic 2D geometry (geometry.prolog)\n This is a joke library. Why it is a joke? Well, it's not 100% legit.\n Some predicates are valid, some aren't.. It's up to you to find what's wrong\n and propose a fix. Enjoy.\n \n @author \"AresAndy\"\n @license BSD\n*\/\n\n:- module(geometry, [point\/2,\n segment\/2,\n\t\t distance_points\/3,\n\t\t segment_lenght\/2,\n\t\t angle\/3,\n arc\/2,\n gradient\/2,\n\t\t radiant\/2,\n horizontal\/1,\n vertical\/1,\n\t\t arc_between_segments\/3\n\t\t perpendicular\/2\n parallel\/2]).\n\npoint(_, _).\n\nsegment(point(_, _), point(_, _)).\n\ndistance_points(point(X1, Y1), point(X2, Y2), Res) :- Res is sqrt(((X2 - X1) ** 2) + ((Y2 - Y1) ** 2)).\n\nsegment_lenght(segment(A, B), Res) :- distance_points(A, B, Res).\n\nangle(point(_, _), _, _).\n\ngradient(Rad, Res) :- Res is (Rad * 180) rdiv pi.\n\nradiant(Gra, Res) :- Res is (Gra * pi) rdiv 180.\n\narc(angle(_, A, B), Res) :- Res is atan(A rdiv B).\n\nvertical(segment(point(X, _), point(Y, _))) :- X =:= Y;\n\nhorizontal(segment(point(_, X), point(_, Y))) :- X =:= Y.\n\narc_between_segments(X, Y, Res) :-\n\tsegment_lenght(X, Xl),\n\tsegment_lenght(Y, Yl),\n\tarc(angle(_, Xl, Yl), SubRes),\n\tgradient(SubRes, Res).\n\nperpendicular(X, Y) :- \n\t(vertical(Y), horizontal(X)); \n\t(vertical(X), horizontal(Y));\n\tarc_between_segments(X, Y, SubRes),\n between(89.9998, 90.9998, SubRes).\n\t\nparallel(X, Y) :- \n\t(vertical(Y), vertical(X)); \n\t(horizontal(X), horizontal(Y));\n\tarc_between_segments(X, Y, SubRes),\n\tbetween(359.9998, 0.9998, SubRes).\n\n","old_contents":"\/** Basic 2D geometry (geometry.prolog)\n This is a joke library. Why it is a joke? Well, it's not 100% legit.\n Some predicates are valid, some aren't.. It's up to you to find what's wrong\n and propose a fix. Enjoy.\n \n @author \"AresAndy\"\n @license BSD\n*\/\n\n:- module(geometry, [point\/2,\n segment\/2,\n\t\t distance_points\/3,\n\t\t segment_lenght\/2,\n\t\t angle\/3,\n arc\/2,\n gradient\/2,\n\t\t radiant\/2,\n horizontal\/1,\n vertical\/1,\n\t\t arc_between_segments\/3\n\t\t perpendicular\/2\n parallel\/2]).\n\npoint(_, _).\n\nsegment(point(_, _), point(_, _)).\n\ndistance_points(point(X1, Y1), point(X2, Y2), Res) :- Res is sqrt(((X2 - X1) ** 2) + ((Y2 - Y1) ** 2)).\n\nsegment_lenght(segment(A, B), Res) :- distance_points(A, B, Res).\n\nangle(point(_, _), _, _).\n\ngradient(Rad, Res) :- Res is (Rad * 180) rdiv pi.\n\nradiant(Gra, Res) :- Res is (Gra * pi) rdiv 180.\n\narc(angle(_, A, B), Res) :- Res is atan(A rdiv B).\n\nvertical(segment(point(X, _), point(Y, _))) :- X =:= Y;\n\nhorizontal(segment(point(_, X), point(_, Y))) :- X =:= Y.\n\narc_between_segments(X, Y, Res) :-\n\tsegment_lenght(X, Xl),\n\tsegment_lenght(Y, Yl),\n\tarc(angle(_, Xl, Yl), Res).\n\nperpendicular(X, Y) :- \n\t(vertical(Y), horizontal(X)); \n\t(vertical(X), horizontal(Y));\n\tarc_between_segments(X, Y, SubRes),\n between(89.9998, 90.9998, SubRes).\n\t\nparallel(X, Y) :- \n\t(vertical(Y), vertical(X)); \n\t(horizontal(X), horizontal(Y));\n\tarc_between_segments(X, Y, SubRes),\n\tbetween(359.9998, 0.9998, SubRes).\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"Prolog"} {"commit":"09e802e3c89044fc34e9f417597afc498eaed464","subject":"Wyszukiwanie wszystkich mo\u017cliwych ruch\u00f3w ps\u00f3w","message":"Wyszukiwanie wszystkich mo\u017cliwych ruch\u00f3w ps\u00f3w\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"\n%------------------ Funkcja moliwych ruchw ------------------%\nmove( Listawej, Listawyj ) :-\n\tfindIdJaguar( Listawej, IdJaguar ),\n\tcanTokenMove(Listawej, IdJaguar, Listawyj).\n\n%------------------ Funkcje moliwego ruchu w danych kierunkach z moliwym biciem ------------------%\n\t%%%%%% Ujemne\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\ttokenMove(IdJaguar2,1,_,_,_,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\ttokenMove(IdJaguar2,_,1,_,_,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\ttokenMove(IdJaguar2,_,_,1,_,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\ttokenMove(IdJaguar2,_,_,_,1,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n%%%%%%%%% dodatnie\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\ttokenMove(IdJaguar2,_,_,_,_,1,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\ttokenMove(IdJaguar2,_,_,_,_,_,1,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\ttokenMove(IdJaguar2,_,_,_,_,_,_,1,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\ttokenMove(IdJaguar2,_,_,_,_,_,_,_,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n%%%%%%%%% specjalne\ncanTokenMove(Listawej, 30, Listawyj):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove(Listawej, 32, Listawyj):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove(Listawej, 34, Listawyj):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove(Listawej, 32, Listawyj):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, 30, Listawyj):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, 34, Listawyj):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n%------------------ Ograniczenia planszy ------------------%\n%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nisEmpty( Id, Lista):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):- % zwraca aktualne id jaguara w licie\n\tnth0(Id, Lista, 2),\n\t!.\nadd_tail([],X,[X]).\nadd_tail([H|T],X,[H|L]):-\n\tadd_tail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], _, _, _, _, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs(Listawej,Listawyj):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n%dogMove(Listawej,35,Listawyj):- !.\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t%Iter1 is Iter+1,\n\t%dogMove(Listawej,Iter1,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,_,_,_,_,_,_,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,_,1,_,_,_,_,_,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,_,_,1,_,_,_,_,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,_,_,_,1,_,_,_,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,_,_,_,_,1,_,_,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,_,_,_,_,_,1,_,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,_,_,_,_,_,_,1,_),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,_,_,_,_,_,_,_,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\n%%%%% specjalne\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], _, _, _, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max","old_contents":"\n%------------------ Funkcja moliwych ruchw ------------------%\nmove( Listawej, Listawyj ) :-\n\tfindIdJaguar( Listawej, IdJaguar ),\n\tcanTokenMove(Listawej, IdJaguar, Listawyj).\n\n%------------------ Funkcje moliwego ruchu w danych kierunkach z moliwym biciem ------------------%\n\t%%%%%% Ujemne\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\ttokenMove(IdJaguar2,1,_,_,_,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\ttokenMove(IdJaguar2,_,1,_,_,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\ttokenMove(IdJaguar2,_,_,1,_,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\ttokenMove(IdJaguar2,_,_,_,1,_,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n%%%%%%%%% dodatnie\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\ttokenMove(IdJaguar2,_,_,_,_,1,_,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\ttokenMove(IdJaguar2,_,_,_,_,_,1,_,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\ttokenMove(IdJaguar2,_,_,_,_,_,_,1,_),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\ttokenMove(IdJaguar2,_,_,_,_,_,_,_,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, IdJaguar, Listawyj):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n%%%%%%%%% specjalne\ncanTokenMove(Listawej, 30, Listawyj):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove(Listawej, 32, Listawyj):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove(Listawej, 34, Listawyj):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove(Listawej, 32, Listawyj):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove(Listawej, 30, Listawyj):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove(Listawej, 34, Listawyj):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n%------------------ Ograniczenia planszy ------------------%\n%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nisEmpty( Id, Lista):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):- % zwraca aktualne id jaguara w licie\n\tnth0(Id, Lista, 2),\n\t!.\nadd_tail([],X,[X]).\nadd_tail([H|T],X,[H|L]):-\n\tadd_tail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], _, _, _, _, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"704aa659bfedf27ca5e73b2f943f44529d06ac68","subject":"Wolf, sheep, and cabbage problem","message":"Wolf, sheep, and cabbage problem\n","repos":"YauHsien\/puzzles","old_file":"wolf-sheep-cabbage\/in-prolog\/wsc.prolog","new_file":"wolf-sheep-cabbage\/in-prolog\/wsc.prolog","new_contents":"%% Wof, sheep, and cabbage problem\n% and Graph theory\n% ------------------------------\n\nnext(wc, wsc).\nnext(w, wc).\nnext(c, wc).\nnext(ws, w).\nnext(sc, c).\nnext(s, ws).\nnext(s, sc).\nnext(wsc, s).\n\n% ?- consult('wolf-sheep-cabbage\/in-prolog\/wsc.prolog').\n%: true.\n%\n% ?- solve(wsc,R).\n%: wsc -> s\n%: s -> ws\n%: ws -> w\n%: w -> wc\n%: R = wsc ;\n%: s -> sc\n%: sc -> c\n%: c -> wc\n%: R = wsc.\n%\nsolve(wsc, Result) :-\n solve(wsc, wsc, Result).\n\nsolve(Src, Via, Result) :-\n next(Via, R1),\n (\n Src == R1,\n !,\n Result = R1;\n\n format(\"~p -> ~p~n\", [Via, R1]),\n solve(Src, R1, Result)\n ).\n","old_contents":"%% Wof, sheep, and cabbage problem\n% and Graph theory\n% ------------------------------\n\nnext(wc, wsc).\nnext(w, wc).\nnext(c, wc).\nnext(ws, w).\nnext(sc, c).\nnext(s, ws).\nnext(s, sc).\nnext(wsc, s).\n\nsolve(wsc, Result) :-\n solve(wsc, wsc, Result).\n\nsolve(Src, Via, Result) :-\n next(Via, R1),\n (\n Src == R1,\n !,\n Result = R1;\n\n format(\"~p -> ~p~n\", [Via, R1]),\n solve(Src, R1, Result)\n ).\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"7ae355b71e0ac8f670a8034f93cc2b135526cac9","subject":"Updated TODO","message":"Updated TODO\n","repos":"koryonik\/swipl-devel,edechter\/swipl-devel,koryonik\/swipl-devel,jn7163\/swipl-devel,koryonik\/swipl-devel,jn7163\/swipl-devel,jn7163\/swipl-devel,jn7163\/swipl-devel,edechter\/swipl-devel,mndrix\/swipl-devel,jn7163\/swipl-devel,koryonik\/swipl-devel,edechter\/swipl-devel,mndrix\/swipl-devel,edechter\/swipl-devel,mndrix\/swipl-devel,mndrix\/swipl-devel,koryonik\/swipl-devel,mndrix\/swipl-devel,edechter\/swipl-devel","old_file":"src\/TODO.yap","new_file":"src\/TODO.yap","new_contents":"TODO for integration of YAP and SWI I\/O systems\n\nConclusions:\n\n * Make Prolog I\/O library from\n\t- pl-stream.c\n\t- pl-file.c\n\t- pl-utf8.c\n\t- pl-text.c (minus conversion text<->Prolog)\n\t- pl-option.c\n\t- pl-error.c\n\n * Take some bits from pl-os.c\n\t- initEncoding()\n\n * Needs state structures for engine and global state\n \t- IO_local_data\n\t- IO_global_data\n\nTODO:\n\n * Abstract some interfaces\n\t- read_pending_input\/3\n * Define generic interfaces\n\t- Memory allocation\n\t- Hash-table management (just renaming?)\n * Cleanup foreign flag interface (naming)\n\n","old_contents":"TODO for integration of YAP and SWI I\/O systems\n\nConclusions:\n\n * Make Prolog I\/O library from\n\t- pl-stream.c\n\t- pl-file.c\n\t- pl-utf8.c\n\t- pl-text.c (minus conversion text<->Prolog)\n\t- pl-option.c\n\t- pl-error.c\n\n * Take some bits from pl-os.c\n\t- initEncoding()\n\n * Needs state structures for engine and global state\n \t- IO_local_data\n\t- IO_global_data\n\nTODO:\n\n * Abstract some interfaces\n\t- read_pending_input\/3\n * Define generic interfaces\n\t- Have all predicates using the PRED_IMPL interface (document)\n\t- Memory allocation\n\t- Hash-table management (just renaming?)\n * Cleanup foreign flag interface (naming)\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Prolog"} {"commit":"1dea71dc42d20a93a37c0b59dde742756a4e7471","subject":"Update taskdb2.prolog","message":"Update taskdb2.prolog","repos":"lsoriano808\/Functional,lsoriano808\/Functional,lsoriano808\/Functional","old_file":"a1\/taskdb2.prolog","new_file":"a1\/taskdb2.prolog","new_contents":"% Author: Landon Soriano\n% Date: 02\/02\/2015\n%% Data base for the list of people who can work, follows the \n%% following format: \n%% \n%% person(ID, TASK_CAPABILITIES, AVAILABLE_HOURS)\n%%\n%% How many hours each person has available and what classes of\n%% tasks they are capable of performing.\n%%\nperson(p1, [a,b], 20).\nperson(p2, [b,c], 10).\nperson(p3, [a,c], 15).\nperson(p4, [c], 30).\n\n%% Data base for tasks that are available to be done.\n%% Follows the following format: \n%%\n%% task(ID, REQUIRED_HOURS, TASK_CLASS)\n%%\n%% How long each task requires and what class it falls under.\n%% \n%%\ntask(t1, a, 5).\ntask(t2, b, 10).\ntask(t3, c, 15).\ntask(t4, c, 10).\ntask(t5, a, 15).\ntask(t6, b, 10).\n\n\n\n","old_contents":"% Author: Landon Soriano\n% Date: 02\/02\/2015\n% Class: ICS 313\n\n%% Data base for the list of people who can work, follows the \n%% following format: \n%% \n%% person(ID, TASK_CAPABILITIES, AVAILABLE_HOURS)\n%%\n%% How many hours each person has available and what classes of\n%% tasks they are capable of performing.\n%%\nperson(p1, [a,b], 20).\nperson(p2, [b,c], 10).\nperson(p3, [a,c], 15).\nperson(p4, [c], 30).\n\n%% Data base for tasks that are available to be done.\n%% Follows the following format: \n%%\n%% task(ID, REQUIRED_HOURS, TASK_CLASS)\n%%\n%% How long each task requires and what class it falls under.\n%% \n%%\ntask(t1, a, 5).\ntask(t2, b, 10).\ntask(t3, c, 15).\ntask(t4, c, 10).\ntask(t5, a, 15).\ntask(t6, b, 10).\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"7d8ff248744ccaea3ae7c5d734979d1fc9ea799a","subject":"Remove flatten method that got replaced by the builtin append.","message":"Remove flatten method that got replaced by the builtin append.\n","repos":"Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch,Tim-Tom\/scratch","old_file":"magic_puzzle.prolog","new_file":"magic_puzzle.prolog","new_contents":"use_module(library(clpfd)).\n\ndiag([], [], _).\ndiag([Row|Rows], [V|T], D) :-\n D1 is D + 1,\n nth1(D, Row, V),\n diag(Rows, T, D1).\n\ndiag(Rows, Diag) :-\n diag(Rows, Diag, 1).\n\nrdiag([], [], _).\nrdiag([Row|Rows], [V|T], D) :-\n D1 is D - 1,\n nth1(D, Row, V),\n rdiag(Rows, T, D1).\n\nrdiag(Rows, Diag) :-\n length(Rows, L),\n rdiag(Rows, Diag, L).\n\nmysum(Value, Operator, List) :-\n sum(List, Operator, Value).\n\nmagic_box(Sum, Size, Domain, Box) :-\n length(Box, Size),\n maplist(same_length(Box), Box),\n append(Box, Vars),\n Vars ins Domain,\n all_distinct(Vars),\n transpose(Box, Cols),\n diag(Box, Diag),\n rdiag(Box, RDiag),\n maplist(mysum(Sum, #=), Box),\n maplist(mysum(Sum, #=), Cols),\n sum(Diag, #=, Sum),\n sum(RDiag, #=, Sum).\n\n% time(findall(Box, (magic_box(21, 3, 3..11, Box), append(Box, Vars), labeling([ff], Vars)), Bag)).\n","old_contents":"use_module(library(clpfd)).\n\nflatten([], [], 0, _) :- !.\nflatten([X|T], Flat, H, W) :-\n length(X, W),\n append(X, Rest, Flat),\n flatten(T, Rest, H0, W),\n H is H0 + 1.\n\nflatten(X, Y) :- flatten(X, Y, _, _).\n\ndiag([], [], _).\ndiag([Row|Rows], [V|T], D) :-\n D1 is D + 1,\n nth1(D, Row, V),\n diag(Rows, T, D1).\n\ndiag(Rows, Diag) :-\n diag(Rows, Diag, 1).\n\nrdiag([], [], _).\nrdiag([Row|Rows], [V|T], D) :-\n D1 is D - 1,\n nth1(D, Row, V),\n rdiag(Rows, T, D1).\n\nrdiag(Rows, Diag) :-\n length(Rows, L),\n rdiag(Rows, Diag, L).\n\nmysum(Value, Operator, List) :-\n sum(List, Operator, Value).\n\nmagic_box(Sum, Size, Domain, Box) :-\n length(Box, Size),\n maplist(same_length(Box), Box),\n append(Box, Vars),\n Vars ins Domain,\n all_distinct(Vars),\n transpose(Box, Cols),\n diag(Box, Diag),\n rdiag(Box, RDiag),\n maplist(mysum(Sum, #=), Box),\n maplist(mysum(Sum, #=), Cols),\n sum(Diag, #=, Sum),\n sum(RDiag, #=, Sum).\n\n% time(findall(Box, (magic_box(21, 3, 3..11, Box), append(Box, Vars), labeling([ff], Vars)), Bag)).\n","returncode":0,"stderr":"","license":"unlicense","lang":"Prolog"} {"commit":"42d3449ebe0918a3192c7d5ac4e5fa76203d9f05","subject":"autorski nth0","message":"autorski nth0\n\nco by \u017cy\u0142o si\u0119 lepiej\n\n#nie\u015bpimyKodzimy!\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"start(Listawej,[Ruch1]):-\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),\n\tnot(wiecejZbitych(Listawej,Listawyj,H)),!.\n\nwiecejZbitych(Listawej,Listawyj,H):-\n\tbegin(Listawej,[H2|Ruch2],[Hb|Finb]),\n\tHb > H.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\n\nnth0(Id, Lista, Value):-\nnth01(0,Lista,Value, Id).\n\nnth01(Iter, [H|T], H, Iter).\n\nnth01(Iter, [H|T], Value, Id):-\nIter1 is Iter +1,\nnth01(Iter1, T, Value, Id).\n\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","old_contents":"start(Listawej,[Ruch1]):-\n\tbegin(Listawej,[H1|Ruch1],[H|Fin]),\n\tnot(wiecejZbitych(Listawej,Listawyj,H)),!.\n\nwiecejZbitych(Listawej,Listawyj,H):-\n\tbegin(Listawej,[H2|Ruch2],[Hb|Finb]),\n\tHb > H.\n\t\n\nbegin(Listawej, Listawyj1, Listawyj):-\n\tmove([0|Listawej],Listawyj1),\n\tallDogs(Listawyj1,Listawyj2),\n\tmove(Listawyj2,Listawyj3),\n\tallDogs(Listawyj3,Listawyj4),\n\tmove(Listawyj4,Listawyj).\n\n\t\n\nmove( [H|Listawej], Listawyj ) :-\n\tfindIdJaguar(Listawej, IdJaguar ),\n\tcanTokenMove([H|Listawej], IdJaguar, Listawyj).\n\n\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\tIdJaguar3 is IdJaguar - 12,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,1,A1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 6,\n\ttokenMove(IdJaguar,1,A,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\tIdJaguar3 is IdJaguar - 10,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,1,B1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 5,\n\ttokenMove(IdJaguar,A,1,B,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\tIdJaguar3 is IdJaguar - 8,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,1,C1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 4,\n\ttokenMove(IdJaguar,A,B,1,C,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\tIdJaguar3 is IdJaguar - 2,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,1,D1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar - 1,\n\ttokenMove(IdJaguar,A,B,C,1,D,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\n\t\n\t\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\tIdJaguar3 is IdJaguar + 2,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,1,E1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 1,\n\ttokenMove(IdJaguar,A,B,C,D,1,E,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\tIdJaguar3 is IdJaguar + 8,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,1,F1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 4,\n\ttokenMove(IdJaguar,A,B,C,D,E,1,F,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\tIdJaguar3 is IdJaguar + 10,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,1,G1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 5,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,1,G),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], IdJaguar, [H1|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\tIdJaguar3 is IdJaguar + 12,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\ttokenMove(IdJaguar2,A1,B1,C1,D1,E1,F1,G1,1),\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], IdJaguar, [H|Listawyj]):-\n\tIdJaguar2 is IdJaguar + 6,\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,1),\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\ncanTokenMove([H|Listawej], 30, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 30, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 34,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 34, [H|Listawyj]):-\n\tIdJaguar2 is 32,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 34, -1, IdJaguar2, Listawyj).\ncanTokenMove([H|Listawej], 32, [H|Listawyj]):-\n\tIdJaguar2 is 30,\n\tisEmpty( IdJaguar2, Listawej ),\n\treplace(Listawej, 32, -1, IdJaguar2, Listawyj).\n\ncanTokenMove([H|Listawej], 30, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 34,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 30, IdJaguar2, IdJaguar3, Listawyj).\ncanTokenMove([H|Listawej], 34, [H1|Listawyj]):-\n\tIdJaguar2 is 32,\n\tIdJaguar3 is 30,\n\tisEmpty( IdJaguar3, Listawej ),\n\tnth0(IdJaguar2, Listawej, 1),\n\tH1 is H +1,\n\treplace(Listawej, 34, IdJaguar2, IdJaguar3, Listawyj).\n\n\n\n\n\n\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nisEmpty( Id, Lista):- \n\tnth0(Id, Lista,0).\nfindIdJaguar( Lista, Id ):-\n\tnth0(Id, Lista, 2),\n\t!.\naddTail([],X,[X]).\naddTail([H|T],X,[H|L]):-\n\taddTail(T,X,L).\n\t\n\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], A, B, C, D, Exit, Exit):-\n\t!.\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V),!.\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V),!.\t\t\n\nallDogs([H|Listawej],[H|Listawyj]):-\n\tdogMove(Listawej,Listawyj).\n\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,0,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,1,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,2,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,3,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,4,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,5,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,6,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,7,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,8,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,9,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,10,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,11,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,12,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,13,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,14,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,15,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,16,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,17,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,18,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,19,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,20,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,21,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,22,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,23,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,24,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,25,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,26,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,27,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,28,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,29,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,30,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,32,Listawyj).\ndogMove(Listawej,Listawyj):-\n\tsingleDog(Listawej,34,Listawyj).\n\n\n\n\nsingleDog(Listawej,Iter,Listawyj):-\n\tnth0(Iter, Listawej, 1),\n\tmoveDog(Listawej,Iter,Listawyj).\n\t\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 6,\n\ttokenMove(IdPies,1,A,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 5,\n\ttokenMove(IdPies,A,1,B,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 4,\n\ttokenMove(IdPies,A,B,1,C,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies - 1,\n\ttokenMove(IdPies,A,B,C,1,D,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 1,\n\ttokenMove(IdPies,A,B,C,D,1,E,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 4,\n\ttokenMove(IdPies,A,B,C,D,E,1,F,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 5,\n\ttokenMove(IdPies,A,B,C,D,E,F,1,G),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\nmoveDog(Listawej, IdPies, Listawyj):-\n\tIdPies2 is IdPies + 6,\n\ttokenMove(IdPies,A,B,C,D,E,F,G,1),\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, IdPies, IdPies2, Listawyj).\n\nmoveDog(Listawej, 30, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 30, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 34,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\nmoveDog(Listawej, 34, Listawyj):-\n\tIdPies2 is 32,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 34, IdPies2, Listawyj).\nmoveDog(Listawej, 32, Listawyj):-\n\tIdPies2 is 30,\n\tisEmpty( IdPies2, Listawej ),\n\treplacePies(Listawej, 32, IdPies2, Listawyj).\t\n\t\n\t\n\t\n\t\nreplacePies(List, Id1, Id2, Exit):-\n\treplacePies(List, Id1, Id2, 0, [], Exit).\n\t\nreplacePies([], A, B, C, Exit, Exit):-\n\t!.\nreplacePies([H|T], Pos, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Pos, Id2, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Pos, Pos, Listawyj,V):-\n\taddTail(Listawyj, 1, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Pos, Pos1, Listawyj1,V),!.\nreplacePies([H|T], Id1, Id2, Pos, Listawyj,V):-\n\taddTail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplacePies(T, Id1, Id2, Pos1, Listawyj1,V),!.\t\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"ea0cda0b9066bb631c6b0e5186da053ab59c48cb","subject":"co\u015b prolog nie dzia\u0142a jak ma","message":"co\u015b prolog nie dzia\u0142a jak ma\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max\n\n\nindexOf([Element|_], Element, 0). % We found the element\nindexOf([_|Tail], Element, Index):-\n indexOf(Tail, Element, Index1), % Check in the tail of the list\n Index is Index1+1. % and increment the resulting index\n\n\n % A AA AAA AAAA AAAAA\n % B BB BBB BBBB BBBBB\n % C CC CCC CCCC CCCCC\n % D DD DDD DDDD DDDDD\n % E EE EEE EEEE EEEEE\n % GG GGG GGGG\n % H HH HHH HHHH HHHHH\n\n \n isEmpty( Id, Lista ):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnth0(Id, Lista, 0).\n FindIdJaguar( Id, Lista ):- % zwraca aktualne id jaguara w licie\n nth0(Id, Lista, 2).\n\n \nreplace([], _, _, _, _, Listawyj).\n\treplace([H|T], Id1, Id2, Id3, Pos, Listawyj):-\n\t\tPos=Id1 ->\n\t\t(\n\t\t\t\n\t\t\tappend(Listawyj, [0], Lista),\n\t\t\tappend(Lista,[],Listawyj),\n\t\t\tPos1 is Pos +1,\n\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n\t\t)\n\t\t;\n\t\t(\n\t\t\tPos=Id2 ->(\n\t\t\t\t\t\tappend(Listawyj, [0], Lista),\n\t\t\t\t\t\tappend(Lista,[],Listawyj),\n\t\t\t\t\t\tPos1 is Pos +1,\n\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tPos=Id3 -> (\n\t\t\t\t\t\t\t\t\t\t append(Listawyj, [2], Lista),\n\t\t\t\t\t\t\t\t\t\t append(Lista,[],Listawyj),\n\t\t\t\t\t\t\t\t\t\tPos1 is Pos +1,\n\t\t\t\t\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\tappend(Listawyj, H, Lista),\n\t\t\t\t\t\t\t\t\t\tappend(Lista,[],Listawyj),\n\t\t\t\t\t\t\t\t\t\tPos1 is Pos +1,\n\t\t\t\t\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t).\n\n\n Move( Listawej, Listawyj ) :-\n\tFindIdJaguar( IdJaguar, Listawej ),\n\ttokenMove(IdJaguar,A,B,C,D,E,F,G,H),\n\t\t(A=1 -> ( \n\t\t\t\t\tisEmpty( IdJaguar-6, Listawej )=false ->\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\ttokenMove(IdJaguar-12,X,_,_,_,_,_,_,_),\n\t\t\t\t\t\t\tX=1 -> ( \n\t\t\t\t\t\t\t\t\t\tisEmpty( IdJaguar-12, Listawej )=true -> \n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\treplace(Listawej, IdJaguar, IdJaguar-6, IdJaguar-12, 0, Listawyj).\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\n\n\t","old_contents":"%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max\n\n\nindexOf([Element|_], Element, 0). % We found the element\nindexOf([_|Tail], Element, Index):-\n indexOf(Tail, Element, Index1), % Check in the tail of the list\n Index is Index1+1. % and increment the resulting index\n\n % A AA AAA AAAA AAAAA\n % B BB BBB BBBB BBBBB\n % C CC CCC CCCC CCCCC\n % D DD DDD DDDD DDDDD\n % E EE EEE EEEE EEEEE\n % GG GGG GGGG\n % H HH HHH HHHH HHHHH\n\n tokenMove(1,0,0,0,1,1,1,0,0,0)\nabilityToMove( [wejscie|_] , IndexEl , [] ):-\n\ttokemMove(A,1,1,1,1,1,1,1,1):-\n\t\tisEqual(A,7),\n\t\tisEqual(A,9),\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"f84f1338da9997a52c24b5e4d413d2a7f6479911","subject":"Bez minus\u00f3w","message":"Bez minus\u00f3w\n","repos":"AdugoGame\/AdugoGameProject","old_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_file":"Adugo\/Adugo\/Prolog\/adugo.prolog","new_contents":"%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max\n\n\nindexOf([Element|_], Element, 0). % We found the element\nindexOf([_|Tail], Element, Index):-\n indexOf(Tail, Element, Index1), % Check in the tail of the list\n Index is Index1+1. % and increment the resulting index\n\n\n % A AA AAA AAAA AAAAA\n % B BB BBB BBBB BBBBB\n % C CC CCC CCCC CCCCC\n % D DD DDD DDDD DDDDD\n % E EE EEE EEEE EEEEE\n % GG GGG GGGG\n % H HH HHH HHHH HHHHH\n\n \n isEmpty( Id, Lista, Exit ):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnth0(Id, Lista, 0),\n\tExit is 1.\n isEmpty( Id, Lista, Exit ):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnot(nth0(Id, Lista, 0),),\n\tExit is 0.\n findIdJaguar( Id, Lista ):- % zwraca aktualne id jaguara w licie\n nth0(Id, Lista, 2).\n\n \n\nadd_tail([],X,[X]).\nadd_tail([H|T],X,[H|L]):-\n\tadd_tail(T,X,L).\n\t\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], _, _, _, _, Exit, Exit).\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V).\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V).\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V).\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V).\t\t\n\n\n\n\n%replace([], _, _, _, _, Listawyj).\n%\treplace([H|T], Id1, Id2, Id3, Pos, Listawyj):-\n%\t\tPos=Id1 ->\n%\t\t(\n%\t\t\t\n%\t\t\tappend(Listawyj, [0], Lista),\n%\t\t\tappend(Lista,[],Listawyj),\n%\t\t\tPos1 is Pos +1,\n%\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t)\n%\t\t;\n%\t\t(\n%\t\t\tPos=Id2 ->(\n%\t\t\t\t\t\tappend(Listawyj, [0], Lista),\n%\t\t\t\t\t\tappend(Lista,[],Listawyj),\n%\t\t\t\t\t\tPos1 is Pos +1,\n%\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t\t\t\t\t);\n%\t\t\t\t\t\t(\n%\t\t\t\t\t\t\tPos=Id3 -> (\n%\t\t\t\t\t\t\t\t\t\t append(Listawyj, [2], Lista),\n%\t\t\t\t\t\t\t\t\t\t append(Lista,[],Listawyj),\n%\t\t\t\t\t\t\t\t\t\tPos1 is Pos +1,\n%\t\t\t\t\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t\t\t\t\t\t\t\t);\n%\n%\t\t\t\t\t\t\t\t\t(\n%\t\t\t\t\t\t\t\t\t\tappend(Listawyj, H, Lista),\n%\t\t\t\t\t\t\t\t\t\tappend(Lista,[],Listawyj),\n%\t\t\t\t\t\t\t\t\t\tPos1 is Pos +1,\n%\t\t\t\t\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t\t\t\t\t\t\t\t)\n%\t\t\t\t\t\t)\n%\t\t).\n\n\n move( [Listawej], [Listawyj] ) :-\n\tfindIdJaguar( IdJaguar, Listawej ),\n\tcanTokenMove(Listawej, IdJaguar, Listawyj).\n\t\n\t%%%%%% Ujemne\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 6,\n\t\tIdJaguar3 is IdJaguar - 12,\n\t\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\t\ttokenMove(IdJagar2,1,_,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 6,\n\t\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 5,\n\t\tIdJaguar3 is IdJaguar - 10,\n\t\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\t\ttokenMove(IdJagar2,_,1,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 5,\n\t\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\t\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 4,\n\t\tIdJaguar3 is IdJaguar - 8,\n\t\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\t\ttokenMove(IdJagar2,_,_,1,_,_,_,_,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 4,\n\t\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 1,\n\t\tIdJaguar3 is IdJaguar - 2,\n\t\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\t\ttokenMove(IdJagar2,_,_,_,1,_,_,_,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar - 1,\n\t\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\t\n\t%%%%%%%%% dodatnie\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 1,\n\t\tIdJaguar3 is IdJaguar + 2,\n\t\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\t\ttokenMove(IdJagar2,_,_,_,_,1,_,_,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 1,\n\t\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 4,\n\t\tIdJaguar3 is IdJaguar + 8,\n\t\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\t\ttokenMove(IdJagar2,_,_,_,_,_,1,_,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 4,\n\t\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 5,\n\t\tIdJaguar3 is IdJaguar + 10,\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\t\ttokenMove(IdJagar2,_,_,_,_,_,_,1,_),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 5,\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 6,\n\t\tIdJaguar3 is IdJaguar + 12,\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\t\ttokenMove(IdJagar2,_,_,_,_,_,_,_,1),\n\t\tisEmpty( IdJaguar3, Listawej, 1 ),\n\t\tisEmpty( IdJaguar2, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar2, IdJaguar3, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\tIdJaguar2 is IdJaguar + 6,\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\t\tisEmpty( IdJaguar2, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar2, Listawyj).\n","old_contents":"%%%%%%%%%%% 1 2 3 4 5 6 7 8\ntokenMove(0,0,0,0,0,1,0,1,1).\ntokenMove(1,0,0,0,1,1,0,1,0).\ntokenMove(2,0,0,0,1,1,1,1,1).\ntokenMove(3,0,0,0,1,1,0,1,0).\ntokenMove(4,0,0,0,1,0,1,1,0).\n\ntokenMove(5,0,1,0,0,1,0,1,0).\ntokenMove(6,1,1,1,1,1,1,1,1).\ntokenMove(7,0,1,0,1,1,0,1,0).\ntokenMove(8,1,1,1,1,1,1,1,1).\ntokenMove(9,0,1,0,1,0,0,1,0).\n\n%%%%%%%%%%%# 1 2 3 4 5 6 7 8\ntokenMove(10,0,1,1,0,1,0,1,1).\ntokenMove(11,0,1,0,1,1,0,1,0).\ntokenMove(12,1,1,1,1,1,1,1,1).\ntokenMove(13,0,1,0,1,1,0,1,0).\ntokenMove(14,1,1,0,1,0,1,1,0).\n\ntokenMove(15,0,1,0,0,1,0,1,0).\ntokenMove(16,1,1,1,1,1,1,1,1).\ntokenMove(17,0,1,0,1,1,0,1,0).\ntokenMove(18,1,1,1,1,1,1,1,1).\ntokenMove(19,0,1,0,1,0,0,1,0).\n\ntokenMove(20,0,1,1,0,1,0,0,0).\ntokenMove(21,0,1,0,1,1,0,0,0).\ntokenMove(22,1,1,1,1,1,1,1,1).\ntokenMove(23,0,1,0,1,1,0,0,0).\ntokenMove(24,1,1,0,1,0,0,0,0).\n\ntokenMove(25,0,0,0,0,0,0,0,0).\ntokenMove(26,0,0,1,0,1,1,0,1).\ntokenMove(27,0,1,0,1,1,0,1,0).\ntokenMove(28,1,0,0,1,0,1,0,1).\ntokenMove(29,0,0,0,0,0,0,0,0).\n\ntokenMove(30,0,0,1,0,0,0,0,0).\ntokenMove(31,0,0,0,0,0,0,0,0).\ntokenMove(32,0,1,0,0,0,0,0,0).\ntokenMove(33,0,0,0,0,0,0,0,0).\ntokenMove(34,1,0,0,0,0,0,0,0).\n\nminimax(Pos, BestNextPos, Val) :- % Pos ma nastepce\n bagof(NextPos, move(Pos, NextPos), NextPosList),\n best(NextPosList, BestNextPos, Val), !.\n\nminimax(Pos, _, Val) :- % Pos nie ma nastepcow\n utility(Pos, Val).\n\nbest([Pos], Pos, Val) :- % Nie ma juz wiecej pozycji do porownania\n minimax(Pos, _, Val), !.\n\nbest([Pos1 | PosList], BestPos, BestVal) :- % Istnieja pozycje do porownania\n minimax(Pos1, _, Val1),\n best(PosList, Pos2, Val2),\n betterOf(Pos1, Val1, Pos2, Val2, BestPos, BestVal).\n\t\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n min_to_move(Pos0), % MIN ma zmienic pozycje na Pos0\n Val0 > Val1, !. % MAX preferuje wieksza wartosc\n\nbetterOf(Pos0, Val0, _, Val1, Pos0, Val0) :- % Pos0 lepsza Pos1\n max_to_move(Pos0), % MAX ma zmienic pozycje na Pos0\n Val0 < Val1, !. % MIN preferuje mniejsza wartosc\n\nbetterOf(_, _, Pos1, Val1, Pos1, Val1). % OW innym przypadku Pos1 lepsza od Pos0\n\n%nalezy zaimplementowac nastepujace metody\n\n%move(+Pos, -NextPos) : mowi o tym ze NextPos jest legalnym ruchem od Pos\n%utility(+Pos, -Val) : mowi o tym, ze Pos jest rowna wartosci Val\n%min_to_move(+Pos) : mowi o tym ze obecny gracz(w kontekscie minmax) na Pos jest mins\n%max_to_move(+Pos) : mowi ze obecny gracz(w kontekscie minmax) na Pos jest max\n\n\nindexOf([Element|_], Element, 0). % We found the element\nindexOf([_|Tail], Element, Index):-\n indexOf(Tail, Element, Index1), % Check in the tail of the list\n Index is Index1+1. % and increment the resulting index\n\n\n % A AA AAA AAAA AAAAA\n % B BB BBB BBBB BBBBB\n % C CC CCC CCCC CCCCC\n % D DD DDD DDDD DDDDD\n % E EE EEE EEEE EEEEE\n % GG GGG GGGG\n % H HH HHH HHHH HHHHH\n\n \n isEmpty( Id, Lista, Exit ):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnth0(Id, Lista, 0),\n\tExit is 1.\n isEmpty( Id, Lista, Exit ):- % sprawdza czy mona wykona ruch, zwraca prawd jeli pole jest puste\n\tnot(nth0(Id, Lista, 0),),\n\tExit is 0.\n findIdJaguar( Id, Lista ):- % zwraca aktualne id jaguara w licie\n nth0(Id, Lista, 2).\n\n \n\nadd_tail([],X,[X]).\nadd_tail([H|T],X,[H|L]):-\n\tadd_tail(T,X,L).\n\t\nreplace(List, Id1, Id2, Id3, Exit):-\n\treplace(List, Id1, Id2, Id3, 0, [], Exit).\n\t\nreplace([], _, _, _, _, Exit, Exit).\nreplace([H|T], Pos, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Pos, Id2, Id3, Pos1, Listawyj1,V).\nreplace([H|T], Id1, Pos, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 0, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Pos, Id3, Pos1, Listawyj1,V).\nreplace([H|T], Id1, Id2, Pos, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, 2, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Pos, Pos1, Listawyj1,V).\nreplace([H|T], Id1, Id2, Id3, Pos, Listawyj,V):-\n\tadd_tail(Listawyj, H, Listawyj1),\n\tPos1 is Pos +1,\n\treplace(T, Id1, Id2, Id3, Pos1, Listawyj1,V).\t\t\n\n\n\n\n%replace([], _, _, _, _, Listawyj).\n%\treplace([H|T], Id1, Id2, Id3, Pos, Listawyj):-\n%\t\tPos=Id1 ->\n%\t\t(\n%\t\t\t\n%\t\t\tappend(Listawyj, [0], Lista),\n%\t\t\tappend(Lista,[],Listawyj),\n%\t\t\tPos1 is Pos +1,\n%\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t)\n%\t\t;\n%\t\t(\n%\t\t\tPos=Id2 ->(\n%\t\t\t\t\t\tappend(Listawyj, [0], Lista),\n%\t\t\t\t\t\tappend(Lista,[],Listawyj),\n%\t\t\t\t\t\tPos1 is Pos +1,\n%\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t\t\t\t\t);\n%\t\t\t\t\t\t(\n%\t\t\t\t\t\t\tPos=Id3 -> (\n%\t\t\t\t\t\t\t\t\t\t append(Listawyj, [2], Lista),\n%\t\t\t\t\t\t\t\t\t\t append(Lista,[],Listawyj),\n%\t\t\t\t\t\t\t\t\t\tPos1 is Pos +1,\n%\t\t\t\t\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t\t\t\t\t\t\t\t);\n%\n%\t\t\t\t\t\t\t\t\t(\n%\t\t\t\t\t\t\t\t\t\tappend(Listawyj, H, Lista),\n%\t\t\t\t\t\t\t\t\t\tappend(Lista,[],Listawyj),\n%\t\t\t\t\t\t\t\t\t\tPos1 is Pos +1,\n%\t\t\t\t\t\t\t\t\t\treplace(T, Id1, Id2, Id3, Pos1, Lista)\n%\t\t\t\t\t\t\t\t\t)\n%\t\t\t\t\t\t)\n%\t\t).\n\n\n move( [Listawej], [Listawyj] ) :-\n\tfindIdJaguar( IdJaguar, Listawej ),\n\tcanTokenMove(Listawej, IdJaguar, Listawyj).\n\t\n\t%%%%%% Ujemne\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\t\ttokenMove(IdJagar-6,1,_,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar-12, Listawej, 1 ),\n\t\tisEmpty( IdJaguar-6, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar-6, IdJaguar-12, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,1,_,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar-6, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar-6, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\t\ttokenMove(IdJagar-5,_,1,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar-10, Listawej, 1 ),\n\t\tisEmpty( IdJaguar-5, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar-5, IdJaguar-10, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,1,_,_,_,_,_,_),\n\t\tisEmpty( IdJaguar-5, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar-5, Listawyj).\n\t\t\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\t\ttokenMove(IdJagar-4,_,_,1,_,_,_,_,_),\n\t\tisEmpty( IdJaguar-8, Listawej, 1 ),\n\t\tisEmpty( IdJaguar-4, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar-4, IdJaguar-8, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,1,_,_,_,_,_),\n\t\tisEmpty( IdJaguar-4, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar-4, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\t\ttokenMove(IdJagar-1,_,_,_,1,_,_,_,_),\n\t\tisEmpty( IdJaguar-2, Listawej, 1 ),\n\t\tisEmpty( IdJaguar-1, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar-1, IdJaguar-2, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,1,_,_,_,_),\n\t\tisEmpty( IdJaguar-1, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar-1, Listawyj).\n\t\n\t%%%%%%%%% dodatnie\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\t\ttokenMove(IdJagar+1,_,_,_,_,1,_,_,_),\n\t\tisEmpty( IdJaguar+2, Listawej, 1 ),\n\t\tisEmpty( IdJaguar+1, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar+1, IdJaguar+2, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,1,_,_,_),\n\t\tisEmpty( IdJaguar+1, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar+1, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\t\ttokenMove(IdJagar+4,_,_,_,_,_,1,_,_),\n\t\tisEmpty( IdJaguar+8, Listawej, 1 ),\n\t\tisEmpty( IdJaguar+4, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar+4, IdJaguar+8, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,_,1,_,_),\n\t\tisEmpty( IdJaguar+4, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar+4, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\t\ttokenMove(IdJagar+5,_,_,_,_,_,_,1,_),\n\t\tisEmpty( IdJaguar+10, Listawej, 1 ),\n\t\tisEmpty( IdJaguar+5, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar+5, IdJaguar+10, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,1,_),\n\t\tisEmpty( IdJaguar+5, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar+5, Listawyj).\n\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\t\ttokenMove(IdJagar+6,_,_,_,_,_,_,_,1),\n\t\tisEmpty( IdJaguar+12, Listawej, 1 ),\n\t\tisEmpty( IdJaguar+6, Listawej, 0 ),\n\t\treplace(Listawej, IdJaguar, IdJaguar+6, IdJaguar+12, Listawyj).\n\tcanTokenMove(Listawej, IdJaguar, Listawyj):-\n\t\ttokenMove(IdJaguar,_,_,_,_,_,_,_,1),\n\t\tisEmpty( IdJaguar+6, Listawej, 1 ),\n\t\treplace(Listawej, IdJaguar, -1, IdJaguar+6, Listawyj).\n","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"84d57bc32a234ccd2f9e36a75fcef5d08a1d2c36","subject":"Update schedule.prolog","message":"Update schedule.prolog","repos":"lsoriano808\/Functional,lsoriano808\/Functional,lsoriano808\/Functional","old_file":"a1\/schedule.prolog","new_file":"a1\/schedule.prolog","new_contents":"% Author: Landon Soriano\n% Date: 02\/02\/2015\n\n%% recurses throughout the list to find possible matches.\n%% follows the people, task, result format)\n%% will look for empty parts of list and see if it is possible\n%% to add a task with that person.\n\nschedule([], X, Y).\nschedule([Elem | Rest], X, [Elem | Result]) :-\n\tschedule(Rest, X, Result).\n\n%% nth(Index, % the index number, starts from 0\n% List, % the list\n% Elem) % the element of List at index position\n% nth is true if Elem is the Index th element of List\n\n%% stopping condition as we are entering an empty list\n%% so we wil stop. \n\nnth(0, [FirstElement | RestOfList], FirstElement).\nnth(N, [_ | RestOfList], Elem) :-\n\tN > 0,\n\tM is N-1,\n\tnth(M, RestOfList, Elem).\n","old_contents":"% Author: Landon Soriano\n% Date: 02\/02\/2015\n% Class: ICS 313\n\n%% recurses throughout the list to find possible matches.\n%% follows the people, task, result format)\n%% will look for empty parts of list and see if it is possible\n%% to add a task with that person.\n\nschedule([], X, Y).\nschedule([Elem | Rest], X, [Elem | Result]) :-\n\tschedule(Rest, X, Result).\n\n%% nth(Index, % the index number, starts from 0\n% List, % the list\n% Elem) % the element of List at index position\n% nth is true if Elem is the Index th element of List\n\n%% stopping condition as we are entering an empty list\n%% so we wil stop. \n\nnth(0, [FirstElement | RestOfList], FirstElement).\nnth(N, [_ | RestOfList], Elem) :-\n\tN > 0,\n\tM is N-1,\n\tnth(M, RestOfList, Elem).","returncode":0,"stderr":"","license":"mit","lang":"Prolog"} {"commit":"3b1e213b0f052fd2b6c20b22d25239308f4cc174","subject":"Added factorial in Prolog.","message":"Added factorial in Prolog.\n","repos":"mishin\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,movb\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,movb\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,movb\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Endika\/Algorithm-Implementations,movb\/Algorithm-Implementations,warreee\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,warreee\/Algorithm-Implementations,mishin\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,movb\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,movb\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,mishin\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,mishin\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,Endika\/Algorithm-Implementations,movb\/Algorithm-Implementations,mishin\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,movb\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,warreee\/Algorithm-Implementations,warreee\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,movb\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,mishin\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,Endika\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,Endika\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Endika\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,movb\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Endika\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,mishin\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Endika\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Endika\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,movb\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,mishin\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,warreee\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,warreee\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,warreee\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,warreee\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,warreee\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,movb\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,mishin\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,mishin\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Endika\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,warreee\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,warreee\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,Endika\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,warreee\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,movb\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,movb\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,mishin\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations","old_file":"Factorial\/Prolog\/jcla1\/factorial.prolog","new_file":"Factorial\/Prolog\/jcla1\/factorial.prolog","new_contents":"factorial(0, 1).\nfactorial(1, 1).\n\nfactorial(A, B) :-\n A > 1, C is A-1, factorial(C, Y), B is A * Y.","old_contents":"","returncode":1,"stderr":"error: pathspec 'Factorial\/Prolog\/jcla1\/factorial.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"ca59abc7521e4bee1b49c44283730a1e03c51dd9","subject":"Added Sudoku solver in Prolog, from 7l7w.","message":"Added Sudoku solver in Prolog, from 7l7w.\n","repos":"joshimoo\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,warreee\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,mishin\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,Endika\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,mishin\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,mishin\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,mishin\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,mishin\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Endika\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,movb\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,movb\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,mishin\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,warreee\/Algorithm-Implementations,movb\/Algorithm-Implementations,Endika\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,mishin\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,warreee\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Endika\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,warreee\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,movb\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,mishin\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,movb\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,movb\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Endika\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,warreee\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Endika\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,warreee\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,movb\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,movb\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,movb\/Algorithm-Implementations,warreee\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,Endika\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,movb\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,movb\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,mishin\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,warreee\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,mishin\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,movb\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,warreee\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,movb\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,movb\/Algorithm-Implementations,warreee\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,warreee\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,mishin\/Algorithm-Implementations,mishin\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,movb\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Endika\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,mishin\/Algorithm-Implementations,warreee\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Endika\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations","old_file":"Sudoku\/Prolog\/jcla1\/sudoku.prolog","new_file":"Sudoku\/Prolog\/jcla1\/sudoku.prolog","new_contents":"valid([]).\nvalid([Head|Tail]) :-\n fd_all_different(Head),\n valid(Tail).\n\nsudoku(Puzzle, Solution) :-\n Solution = Puzzle,\n\n Puzzle = [S11, S12, S13, S14, S15, S16, S17, S18, S19,\n S21, S22, S23, S24, S25, S26, S27, S28, S29,\n S31, S32, S33, S34, S35, S36, S37, S38, S39,\n S41, S42, S43, S44, S45, S46, S47, S48, S49,\n S51, S52, S53, S54, S55, S56, S57, S58, S59,\n S61, S62, S63, S64, S65, S66, S67, S68, S69,\n S71, S72, S73, S74, S75, S76, S77, S78, S79,\n S81, S82, S83, S84, S85, S86, S87, S88, S89,\n S91, S92, S93, S94, S95, S96, S97, S98, S99],\n\n fd_domain(Solution, 1, 9),\n\n Row1 = [S11, S12, S13, S14, S15, S16, S17, S18, S19],\n Row2 = [S21, S22, S23, S24, S25, S26, S27, S28, S29],\n Row3 = [S31, S32, S33, S34, S35, S36, S37, S38, S39],\n Row4 = [S41, S42, S43, S44, S45, S46, S47, S48, S49],\n Row5 = [S51, S52, S53, S54, S55, S56, S57, S58, S59],\n Row6 = [S61, S62, S63, S64, S65, S66, S67, S68, S69],\n Row7 = [S71, S72, S73, S74, S75, S76, S77, S78, S79],\n Row8 = [S81, S82, S83, S84, S85, S86, S87, S88, S89],\n Row9 = [S91, S92, S93, S94, S95, S96, S97, S98, S99],\n\n Col1 = [S11, S21, S31, S41, S51, S61, S71, S81, S91],\n Col2 = [S12, S22, S32, S42, S52, S62, S72, S82, S92],\n Col3 = [S13, S23, S33, S43, S53, S63, S73, S83, S93],\n Col4 = [S14, S24, S34, S44, S54, S64, S74, S84, S94],\n Col5 = [S15, S25, S35, S45, S55, S65, S75, S85, S95],\n Col6 = [S16, S26, S36, S46, S56, S66, S76, S86, S96],\n Col7 = [S17, S27, S37, S47, S57, S67, S77, S87, S97],\n Col8 = [S18, S28, S38, S48, S58, S68, S78, S88, S98],\n Col9 = [S19, S29, S39, S49, S59, S69, S79, S89, S99],\n\n Sq1 = [S11, S12, S13, S21, S22, S23, S31, S32, S33],\n Sq2 = [S14, S15, S16, S24, S25, S26, S34, S35, S36],\n Sq3 = [S17, S18, S19, S27, S28, S29, S37, S38, S39],\n Sq4 = [S41, S42, S43, S51, S52, S53, S61, S62, S63],\n Sq5 = [S44, S45, S46, S54, S55, S56, S64, S65, S66],\n Sq6 = [S47, S48, S49, S57, S58, S59, S67, S68, S69],\n Sq7 = [S71, S72, S73, S81, S82, S83, S91, S92, S93],\n Sq8 = [S74, S75, S76, S84, S85, S86, S94, S95, S96],\n Sq9 = [S77, S78, S79, S87, S88, S89, S97, S98, S99],\n\n valid([Row1, Row2, Row3, Row4, Row5, Row6, Row7, Row8, Row9,\n Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9,\n Sq1, Sq2, Sq3, Sq4, Sq5, Sq6, Sq7, Sq8, Sq9]),\n\n fd_labeling(Puzzle).\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sudoku\/Prolog\/jcla1\/sudoku.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"dc569b7015fe3e9745208bac1093bc27f6d636eb","subject":"Add test","message":"Add test","repos":"IanRiceDev\/Enigma-plus-plus","old_file":"Test.prolog","new_file":"Test.prolog","new_contents":"Test\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Test.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"6b7398c264d0a40236c89c86241370c6ca588cca","subject":"\tmodified: ex1.prolog","message":"\tmodified: ex1.prolog\n","repos":"KevinHivert\/Analyseur-Prolog","old_file":"V2\/ex1.prolog","new_file":"V2\/ex1.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/KevinHivert\/Analyseur-Prolog.git\/'\n","license":"unlicense","lang":"Prolog"} {"commit":"8906c904953585fdc687bd39c33291783cd8446a","subject":"ajout arbres 3 branches","message":"ajout arbres 3 branches\n","repos":"KevinHivert\/Analyseur-Prolog","old_file":"V2\/ex2.prolog","new_file":"V2\/ex2.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/KevinHivert\/Analyseur-Prolog.git\/'\n","license":"unlicense","lang":"Prolog"} {"commit":"ffce7efffaa350cbcb40a374b78536a27846e4db","subject":"added mergesort in prolog","message":"added mergesort in prolog\n","repos":"kennyledet\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Endika\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,movb\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,mishin\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Endika\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,warreee\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,movb\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,warreee\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Endika\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,mishin\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,warreee\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,mishin\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,Endika\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,movb\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,warreee\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,movb\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,movb\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,mishin\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,warreee\/Algorithm-Implementations,mishin\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,mishin\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,movb\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Endika\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,mishin\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,movb\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Endika\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,warreee\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Endika\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,movb\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Endika\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,movb\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Endika\/Algorithm-Implementations,warreee\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Endika\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,movb\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,mishin\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,mishin\/Algorithm-Implementations,mishin\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,movb\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,mishin\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Endika\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,mishin\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,mishin\/Algorithm-Implementations,warreee\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,warreee\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,warreee\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,movb\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,warreee\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,warreee\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,movb\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Endika\/Algorithm-Implementations","old_file":"Merge_Sort\/Prolog\/jcla1_mergesort.prolog","new_file":"Merge_Sort\/Prolog\/jcla1_mergesort.prolog","new_contents":"first([H|_], H).\n\nsplit(A, B, C) :-\n append(B, C, A), length(B, L1), length(C, L2), L1 = L2.\nsplit(A, B, C) :-\n append(B, C, A), length(B, L1), length(C, L2), L3 is L2+1, L1 = L3.\n\n\nmerge([], R, R).\nmerge(L, [], L).\n\nmerge([L1|L2], R, B) :-\n first(R, R1), L1 =< R1, merge(L2, R, C), append([L1], C, B).\nmerge(L, [R1|R2], B) :-\n first(L, L1), R1 < L1, merge(R2, L, C), append([R1], C, B).\n\n\nmergesort([H|[]], [H]).\n\nmergesort(A, B) :-\n length(A, Len), Len > 1,\n split(A, L, R),\n mergesort(L, SL), mergesort(R, SR),\n merge(SL, SR, B).","old_contents":"","returncode":1,"stderr":"error: pathspec 'Merge_Sort\/Prolog\/jcla1_mergesort.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"dd51b932920e4ba07b064daefaaf1b118fbdae35","subject":"can infer inherited types","message":"can infer inherited types\n","repos":"hscells\/CSC344,hscells\/CSC344,hscells\/CSC344","old_file":"Assignment 4\/typecheck.prolog","new_file":"Assignment 4\/typecheck.prolog","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Assignment' did not match any file(s) known to git\nerror: pathspec '4\/typecheck.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"1494c10a415796ef3b3dc5180ea9270d21f90f80","subject":"personnes","message":"personnes\n","repos":"KevinHivert\/Analyseur-Prolog","old_file":"V2\/partie1.prolog","new_file":"V2\/partie1.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/KevinHivert\/Analyseur-Prolog.git\/'\n","license":"unlicense","lang":"Prolog"} {"commit":"824efcd0e4f9019e976a7d82c00055006eae2588","subject":"Bient\u00f4t torcher la partie 2","message":"Bient\u00f4t torcher la partie 2\n","repos":"KevinHivert\/Analyseur-Prolog","old_file":"V2\/ex2.prolog","new_file":"V2\/ex2.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/KevinHivert\/Analyseur-Prolog.git\/': The requested URL returned error: 403\n","license":"unlicense","lang":"Prolog"} {"commit":"0d6e3f67a7991fc8dfe8a7c3c18a65c95b217bb5","subject":"pre merge\tmodified: ex1.prolog","message":"pre merge\tmodified: ex1.prolog\n","repos":"KevinHivert\/Analyseur-Prolog","old_file":"V2\/ex1.prolog","new_file":"V2\/ex1.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/KevinHivert\/Analyseur-Prolog.git\/'\n","license":"unlicense","lang":"Prolog"} {"commit":"a6012075c36b9f8c7959a404660c14c47bd2a835","subject":"retest","message":"retest\n","repos":"josd\/etc","old_file":"equation4\/equation4.prolog","new_file":"equation4\/equation4.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/josd\/etc.git\/'\n","license":"mit","lang":"Prolog"} {"commit":"da6687113105111fcded05f8af62ad07838546c8","subject":"Wolf, sheep, and cabbage problem","message":"Wolf, sheep, and cabbage problem\n","repos":"YauHsien\/puzzles","old_file":"wolf-sheep-cabbage\/in-prolog\/wsc.prolog","new_file":"wolf-sheep-cabbage\/in-prolog\/wsc.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: unable to access 'https:\/\/github.com\/YauHsien\/puzzles.git\/': The requested URL returned error: 403\n","license":"mit","lang":"Prolog"} {"commit":"3cab1d5da267e6bf07e53d62f88a7d9de53de570","subject":"ready for submission","message":"ready for submission\n","repos":"hscells\/CSC344,hscells\/CSC344,hscells\/CSC344","old_file":"Assignment 4\/typecheck.prolog","new_file":"Assignment 4\/typecheck.prolog","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Assignment' did not match any file(s) known to git\nerror: pathspec '4\/typecheck.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"b70ed17e05a74cf69cbe2a42892bae7e97bb27c9","subject":"nice-io added","message":"nice-io added\n","repos":"AresAndy\/Prolog-examples","old_file":"nice-io.prolog","new_file":"nice-io.prolog","new_contents":"\/** Format-less I\/O for Prolog (nice-io.prolog)\n\n This file includes a series of predicates, so that you can\n read and write without worring about the full-stop thing\n (presumes that the keyboard is buffered). Won't work with\n Arity Prolog.\n\n @author \"AresAndy\"\n @license BSD\n\n ## Legend ##\n EOL = End Of Line\n *aux = auxiliary (for instance used for tail recursion)\n*\/\n\n:- module(nice-io, [read_str\/1,\n\t\t read_atom\/1,\n\t\t read_num\/1,\n write_str\/1]).\n\n% =========================\n% read_str and read_str_aux\n%\n% Reads a string until an EOL is reached.\n% read_str_aux is an auxiliary predicate, shouldn't be used\n% on its own.\n\nread_str_aux(-1, []) :- !. % invalid char\nread_str_aux(10, []) :- !. % UNIX EOL\nread_str_aux(13, []) :- !. % M$ EOL\nread_str_aux(Char, [Char|Rest]) :- read_str(Rest).\n\nread_str(String) :- \n\tget0(Char), \n\tread_str_aux(Char,String).\n\n% =========================\n% read_atom\n%\n% Reads a string and converts it into an atom.\n% Not quite fault-tollerant (bad atom syntax might fail on this\n% one).\n\nread_atom(Atom) :- \n\tread_str(String), \n\tname(Atom, String).\n\n% =========================\n% read_num\n%\n% Reads a string and converts it into a number.\n% Not quite fault-tollerant (bad number syntax might fail on this\n% one).\n\nread_num(Num) :- \n\tread_str(String), \n\tname(Num, String).\n\n% =========================\n% write_str\n%\n% I believe this one is self-explanatory.\n\nwrite_str([]).\nwrite_str([Char|Rest]) :- \n\tput(Char), \n\twrite_str(Rest).\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nice-io.prolog' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Prolog"} {"commit":"549008ffd00bac92b532a7bafbfc869445dbcb82","subject":"Added fibonacci in Prolog.","message":"Added fibonacci in Prolog.","repos":"sugiartocokrowibowo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,mishin\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,movb\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,mishin\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,movb\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,warreee\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Endika\/Algorithm-Implementations,mishin\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,mishin\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,warreee\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,mishin\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Endika\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,movb\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,warreee\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,movb\/Algorithm-Implementations,warreee\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,movb\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,movb\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,mishin\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,warreee\/Algorithm-Implementations,mishin\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,warreee\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,warreee\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Endika\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Endika\/Algorithm-Implementations,movb\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Endika\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,mishin\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,warreee\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,Endika\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Endika\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,movb\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,mishin\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Endika\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,movb\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,Endika\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,AntonioModer\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,aayushKumarJarvis\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,Yonaba\/Algorithm-Implementations,movb\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,warreee\/Algorithm-Implementations,movb\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,mishin\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,jb1717\/Algorithm-Implementations,Endika\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,isalnikov\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,movb\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,n1ghtmare\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,warreee\/Algorithm-Implementations,Endika\/Algorithm-Implementations,pravsingh\/Algorithm-Implementations,Etiene\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,Sweet-kid\/Algorithm-Implementations,mishin\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,mishin\/Algorithm-Implementations,girishramnani\/Algorithm-Implementations,imrandomizer\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,mishin\/Algorithm-Implementations,mishin\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,varunparkhe\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,warreee\/Algorithm-Implementations,imanmafi\/Algorithm-Implementations,praveenjha527\/Algorithm-Implementations,jiang42\/Algorithm-Implementations,vikas17a\/Algorithm-Implementations,rohanp\/Algorithm-Implementations,Endika\/Algorithm-Implementations,kidaa\/Algorithm-Implementations,sugiartocokrowibowo\/Algorithm-Implementations,joshimoo\/Algorithm-Implementations,kennyledet\/Algorithm-Implementations,Endika\/Algorithm-Implementations","old_file":"Fibonacci_series\/Prolog\/jcla1\/fibonacci.prolog","new_file":"Fibonacci_series\/Prolog\/jcla1\/fibonacci.prolog","new_contents":"fib(0, 0).\nfib(1, 1).\nfib(N, A) :-\n N1 is N-1, N2 is N-2,\n fib(N1, B), fib(N2, C),\n A is B + C.\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Fibonacci_series\/Prolog\/jcla1\/fibonacci.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"faee72d6e2d2883a7f57acb4b455b2f865c9a4c7","subject":"add some sample predicates that can be imported from Pg","message":"add some sample predicates that can be imported from Pg\n","repos":"salva\/plswipl","old_file":"example.prolog","new_file":"example.prolog","new_contents":"\n:- module(example, [bar\/2, baz\/2, prolog_length\/2]).\n\nbar(X, Z) :-\n Z is X * 2 .\n\nbaz(_, 'bingo!').\n\nbreak_chars(String, Char) :-\n atom_chars(String, Chars),\n member(Char, Chars).\n\nprolog_length(X, L) :-\n atom_chars(X, A),\n length(A, L).","old_contents":"","returncode":1,"stderr":"error: pathspec 'example.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"} {"commit":"8b80e42cde8a30c9a24b304fe0b91cf661a4b6d1","subject":"geometry (if we might say so :D) added","message":"geometry (if we might say so :D) added\n","repos":"AresAndy\/Prolog-examples","old_file":"geometry.prolog","new_file":"geometry.prolog","new_contents":"\/** Basic 2D geometry (geometry.prolog)\n This is a joke library. Why it is a joke? Well, it's not 100% legit.\n Some predicates are valid, some aren't.. It's up to you to find what's wrong\n and propose a fix. Enjoy.\n \n @author \"AresAndy\"\n @license BSD\n*\/\n\n:- module(geometry, [point\/2,\n segment\/2,\n\t\t distance_points\/3,\n\t\t segment_lenght\/2,\n\t\t angle\/3,\n arc\/2,\n gradient\/2,\n\t\t radiant\/2,\n horizontal\/1,\n vertical\/1,\n\t\t arc_between_segments\/3\n\t\t perpendicular\/2\n parallel\/2]).\n\npoint(_, _).\n\nsegment(point(_, _), point(_, _)).\n\ndistance_points(point(X1, Y1), point(X2, Y2), Res) :- Res is sqrt(((X2 - X1) ** 2) + ((Y2 - Y1) ** 2)).\n\nsegment_lenght(segment(A, B), Res) :- distance_points(A, B, Res).\n\nangle(point(_, _), _, _).\n\ngradient(Rad, Res) :- Res is (Rad * 180) rdiv pi.\n\nradiant(Gra, Res) :- Res is (Gra * pi) rdiv 180.\n\narc(angle(_, A, B), Res) :- Res is atan(A rdiv B).\n\nvertical(segment(point(X, _), point(Y, _))) :- X =:= Y;\n\nhorizontal(segment(point(_, X), point(_, Y))) :- X =:= Y.\n\narc_between_segments(X, Y, Res) :-\n\tsegment_lenght(X, Xl),\n\tsegment_lenght(Y, Yl),\n\tarc(angle(_, Xl, Yl), Res).\n\nperpendicular(X, Y) :- \n\t(vertical(Y), horizontal(X)); \n\t(vertical(X), horizontal(Y));\n\tarc_between_segments(X, Y, SubRes),\n between(89.9998, 90.9998, SubRes).\n\t\nparallel(X, Y) :- \n\t(vertical(Y), vertical(X)); \n\t(horizontal(X), horizontal(Y));\n\tarc_between_segments(X, Y, SubRes),\n\tbetween(359.9998, 0.9998, SubRes).\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'geometry.prolog' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Prolog"} {"commit":"6a74b7734b95b381e88fc5a07c382d653ae14168","subject":"Verif des groupes verbaux","message":"Verif des groupes verbaux\n","repos":"KevinHivert\/Analyseur-Prolog","old_file":"V2\/ex1.prolog","new_file":"V2\/ex1.prolog","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/KevinHivert\/Analyseur-Prolog.git\/'\n","license":"unlicense","lang":"Prolog"} {"commit":"8527c9ad2b84abc95fdaff1eed5f9d2c644f1bad","subject":"much better inference","message":"much better inference\n","repos":"hscells\/CSC344,hscells\/CSC344,hscells\/CSC344","old_file":"Assignment 4\/typecheck.prolog","new_file":"Assignment 4\/typecheck.prolog","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Assignment' did not match any file(s) known to git\nerror: pathspec '4\/typecheck.prolog' did not match any file(s) known to git\n","license":"mit","lang":"Prolog"}