Đã Hủy

Prolog Assignment

Let the squares of the chessboard be represented by pairs of their coordinates of the form

[X; Y ], where both X and Y are between 1 and 8.

(a) Defi ne the relation jump(Square1,Square2 ) according to the knight jump on the chess-

board. Assume that Square1 is always instantiated to a square while Square2 can be unin-

stantiated. For example:

?- jump([1; 1]; S).

S = [3; 2];

S = [2; 3];


(b) Defi ne the relation knightpath(Path) where Path is a list of squares that represent a legal

path of a knight on the empty chessboard.

(c) Using this knightpath relation, write a question to find any knight's path of length 4

moves from square [2; 1] to the opposite edge of the board (Y = 8) that goes through square

[5; 4] after the second move.

Submit two (ascii) files. The first file should contain your

program which will include your rules for questions (a) and (b). The second fi le should contain

the query for question (c) and all corresponding answers. In addition, the second le should

contain ten more queries, and corresponding answers. These queries should demonstrate that

you tested your program on di erent cases. Your second le should be readable, containing

the queries on separate lines.

Must be done in 6 HOURS!

Kĩ năng: Prolog

Xem nhiều hơn: knightpath prolog, prolog knight square, prolog assignment chess, prolog assignment, ten second, ten questions, ne moves, write assignment, ne, knight, assignment write, assignment c, board question, chess board moves program, knight moves, chess move, addition program, assignment questions, program move files, convert obs files ascii text files, convert binary files ascii online, convert binary files ascii, chessboard, answers assignment questions, write question answers

Về Bên Thuê:
( 0 nhận xét ) alexandria, United States

ID dự án: #1020105

1 freelancer đang chào giá trung bình $100 cho công việc này


Hi, I am expert at Prolog and can surely satisfy you. Please check your inbox

$100 USD trong 0 ngày
(0 Nhận xét)