Documente Academic
Documente Profesional
Documente Cultură
x2o
4ox
78x
'
*/
/* lists must be same length tim- these were getting triggered, how?
Loc > 1,
M is Loc - 1 ,
showBoard([]).
showBoard([H|T]) :- put(H),showBoard1(T).
showBoard1([H|T]) :- put(H),showBoard2(T).
showBoard2([H|T]) :- put(H),nl,showBoard(T).
win(A , [A,A,A,_,_,_,_,_,_]).
win(A , [_,_,_,A,A,A,_,_,_]).
win(A , [_,_,_,_,_,_,A,A,A]).
win(A , [A,_,_,A,_,_,A,_,_]).
win(A , [_,A,_,_,A,_,_,A,_]).
win(A , [_,_,A,_,_,A,_,_,A]).
win(A , [A,_,_,_,A,_,_,_,A]).
win(A , [_,_,A,_,A,_,A,_,_]).
cat([]).
cat([H|T]) :- H \= b, cat(T).
[a,a,a,@,@,@,@,@,@],
[@,@,@,a,a,a,@,@,@],
[@,@,@,@,@,@,a,a,a],
[a,@,@,a,@,@,a,@,@],
[@,a,@,@,a,@,@,a,@],
[@,@,a,@,@,a,@,@,a],
[a,@,@,@,a,@,@,@,a],
[@,@,a,@,a,@,a,@,@]]).
countThreatsFamulus(_ , _ , N , N , []).
M is SoFar + 1 ,
a threat is having two of the 3 required elements filled in, and the remaining
one blank.
countThreats(x , Board , N) ,
M \= N.
NThreats >= 2.
Next is Loc + 1,
NThreats >= 1.
Next is Loc + 1,
Next is Loc + 1,