Как получить integer Visual Prolog 5.2
В run_white мне нужно получить Id как integer,я долго не могу это сделать. Может можно считать как-то по другому кроме readln, либо сделать из string в integer
predicates
%figure(id,color,row,col)
nondeterm figure(integer, symbol, integer, integer).
%walk(id,x,y)
walk(integer,symbol,integer,integer).
nondeterm run_white.
%nondeterm run_black.
clauses
figure(1,white,1,1).
figure(2,white,1,3).
figure(3,white,1,5).
figure(4,white,1,7).
figure(5,white,2,1).
figure(6,white,2,4).
figure(7,white,2,6).
figure(8,white,2,8).
figure(9,white,3,1).
figure(10,white,3,3).
figure(11,white,3,5).
figure(12,white,3,7).
figure(13,black,8,2).
figure(14,black,8,4).
figure(15,black,8,6).
figure(16,black,8,8).
figure(17,black,7,1).
figure(18,black,7,3).
figure(19,black,7,5).
figure(20,black,7,7).
figure(21,black,6,2).
figure(22,black,6,4).
figure(23,black,6,6).
figure(24,black,6,8).
walk(Id, Color, Row, Column) :-
figure(Id, OtherColor, Row, Column), OtherColor >< Color.
run_white:-
figure(A, "white", C, D),
write("id: ", A," color: ", "white", " row: ",C," col: ", D), nl,fail,
write("Now is white."),nl,
write("Enter what id you want move?: "),readln(Id),nl,
write("Enter on which row you want move?: "),readln(Row),nl,
write("Enter on which column you want move?: "),readln(Column),nl,
walk(Id,"white",Row,Column).
goal
run_white.