move(A) :- good(A), empty(A), !.
good(A) :- ordered_line(A, B, C, D), o(A), o(B), o(C), empty(D), write('winning move detected.'), write(D), nl, assert(x(D)).
good(A) :- ordered_line(A, B, C, D), o(A), o(B), empty(C), o(D), write('winning move detected.'), write(C), nl, assert(x(C)).
good(A) :- ordered_line(A, B, C, D), o(A), empty(B), o(C), o(D), write('winning move detected.'), write(B), nl, assert(x(B)).
good(A) :- ordered_line(A, B, C, D), empty(A), o(B), o(C), o(D), write('winning move detected.'), write(A), nl, assert(x(A)).
good(A) :- ordered_line(A, B, C, D), o(A), o(B), empty(C), empty(D), write('attempting to block.'), write(C), nl, assert(x(C)).
good(A) :- ordered_line(A, B, C, D), o(A), empty(B), o(C), empty(D), write('attempting to block.'), write(B), nl, assert(x(B)).
good(A) :- ordered_line(A, B, C, D), empty(A), o(B), o(C), empty(D), write('attempting to block.'), write(A), nl, assert(x(A)).
% good(5). good(1). good(3). good(7). good(9). good(2). good(4). good(6).
% good(8). good(10). good(11). good(12). good(13). good(14). good(15).
% good(16).