次の問題があります。キューブをテーブルに作成するタワーがいくつかあります。 a
b d
c e
------------------- <- table
今、私はこの1つのように、別の状況にキューブを移動したい: c e
a b d
-------------------
のPrologプログラムは、例えば、このような状況を取得するための手順を印
値を取得する方法: pos(10, 20).
は、どのように私は最初のPOS項(10)を返します述語を書くことができます。仕事の get_pos_x(Pos) :- % should return the first pos param(10).
例: get_pos_x(pos(10,20)) :- % should write 10.
- 私はいくつかの条件があります: moves(1, [1]).
moves(1, [2]).
moves(1, [3]).
は、どのように私は次の言葉を得ることができますか? moves(1, [1,2,3]).
% I have
moves(1, [1]).
moves(1, [2]).
moves(1, [3]).
% I need to wri