You are not allowed to use any pre-dened predicates (other thanis/2, =/2 and similar), unless explicitly indicated.
![4. (i) Code a predicate winner/2 that checks whether a given player (either x or o) has won tic-tac-toe, which means that he has occupied a line of three squares (horizontally, diagonally or vertically) ?- winner(x, [x,o,o, 0 x, free]) true (i) Code a predicate move/3 that checks whether the given transition between two configurations of the board is legal for a given player. This means that the new configuration differs from the previous one by exactly one formerly free square being now occupied by the player. The predicate should also be able to generate all legal moves from the given configuration for the given player free, free, ?- move(x, [x, 0 0 x, free, free], [x, o, free , 0 x, free, free]). true](https://d2vlcm61l7u1fs.cloudfront.net/media%2F901%2F901688a0-d210-4935-902c-cae2dc1f0a08%2FphpMmVk8c.png)
4.
OR
PayPal Gateway not configured
OR
PayPal Gateway not configured
You are not allowed to use any pre-dened predicates (other thanis/2, =/2 and similar), unless explicitly indicated.
![4. (i) Code a predicate winner/2 that checks whether a given player (either x or o) has won tic-tac-toe, which means that he has occupied a line of three squares (horizontally, diagonally or vertically) ?- winner(x, [x,o,o, 0 x, free]) true (i) Code a predicate move/3 that checks whether the given transition between two configurations of the board is legal for a given player. This means that the new configuration differs from the previous one by exactly one formerly free square being now occupied by the player. The predicate should also be able to generate all legal moves from the given configuration for the given player free, free, ?- move(x, [x, 0 0 x, free, free], [x, o, free , 0 x, free, free]). true](https://d2vlcm61l7u1fs.cloudfront.net/media%2F901%2F901688a0-d210-4935-902c-cae2dc1f0a08%2FphpMmVk8c.png)
4.
PayPal Gateway not configured
PayPal Gateway not configured