简体   繁体   中英

override an element in a list in prolog

I have the following problem:

I have a list with 9 positions and I have this function putPiece(Piece, Board, Line, Column) that puts a Piece in a Position Line, Column of a Board (the list of 9 positions) I'm trying to check if any position is already filled so that I don't try to put anything in it since it isn't possible (right?) can you please help me make a function checkIfFree(Board, Line, Column) that check is the position (Line, Column) of the board is already occupied or not...

假设一个自由位置由一个自由变量var(X)应该可以解决该问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM