Skip to content

Instantly share code, notes, and snippets.

@MiLk
Created June 18, 2012 18:28
Show Gist options
  • Select an option

  • Save MiLk/2949860 to your computer and use it in GitHub Desktop.

Select an option

Save MiLk/2949860 to your computer and use it in GitHub Desktop.
IA TROP COOL
isBord(M):- member(M,[11,12,13,14,15,21,31,41,51,52,53,54,55,15,25,35,45]).
coups_gagnants(_,[],[]):-!.
coups_gagnants(P,[(Depart,Arrivee,O)|Q],[(Depart,Arrivee,O)|L]) :- isMontagne(P,Arrivee),isBord(Arrivee),coups_gagnants(P,Q,L), !.
coups_gagnants(P,[_|Q],L):- coups_gagnants(P,Q,L).
% gain immediat
meilleur_coup(P,C) :- coups_possibles(P,L), coups_gagnants(P,L,[C|_]).
meilleur_coup(P,C):- coups_possibles(P,L), length(L,Taille), random(1,Taille,N), get(L,N,C).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment