1
분명히 그 바보 같은 질문이지만 나는 그것에 대해 스스로 대답 할 수 없습니다. 나는 다음과 같은 코드가 있습니다 그래서 문자열 1500 (200)가 연결된다계산을 위해 쿼리 결과를 사용하십시오
%% Ownedby-relationship in monopoly
ownedby(bank,weststation).
%% Account-Value:
account(player1,1500).
%% Prices
price(weststation,200).
%% Buy an estate in monopoly
buy(X,Y):-
ownedby(bank,X),
!,
retract(ownedby(bank, X)),
assert(ownedby(Y,X)),
price(X,Price),
account(Y,Accountold),
retract(account(Y,Accountold)),
assert(account(Y,Accountold-Price)).
%% Example:
buy(player1,weststation).
%% RESULT:
account(player1,X).
1500-200
을하지만 숫자는 substracted되지 않습니다 ... :(TEH 이유는