Hello,
i am a newbie and i have the C-like code:
------
if( x > 10){
x = x + 5 - y;
y = x;
}else{
y = 0;
x = 0;
}
------
and i would to figure how the above code would be in prolog.
So, i was trying :
------
( X > 10
-> X is X + 5 - Y,
Y is X
;
Y is 0,
X is 0
) .
------
but i am not certain, is the line "X is X + 5 - Y" correct?
Thank you.
i am a newbie and i have the C-like code:
------
if( x > 10){
x = x + 5 - y;
y = x;
}else{
y = 0;
x = 0;
}
------
and i would to figure how the above code would be in prolog.
So, i was trying :
------
( X > 10
-> X is X + 5 - Y,
Y is X
;
Y is 0,
X is 0
) .
------
but i am not certain, is the line "X is X + 5 - Y" correct?
Thank you.