-
Notifications
You must be signed in to change notification settings - Fork 1
/
diag.pl
17 lines (12 loc) · 903 Bytes
/
diag.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
:- consult(puissance4).
completerTrousMatriceParTirets([],[]).
completerTrousMatriceParTirets([Tete|Queue], NB) :- completerListeAvecTirets(Tete,NouvelleListe),
completerTrousMatriceParTirets(Queue, BoardComplete),
append([NouvelleListe],BoardComplete,NB).
completerListeAvecTirets(Liste,NouvelleListe) :- length(Liste,Taille),
Taille < 6,
append(Liste,['-'],ListeCompletee),
completerListeAvecTirets(ListeCompletee,NouvelleListe), !.
completerListeAvecTirets(Liste,Liste) :- !.
test() :- completerTrousMatriceParTirets([['X','O','X','O','X','O'],['X','X','O','O','X','X'],['X','O','O','X','O'],['X','O','X','O'],['O','X','O'],['X','O'],['X']],NB),
afficherplateau(NB).