0

私は Tetris ゲームを作成していますが、自分の事実にポイントを追加する方法を知りたいです。

 (deftemplate point
 (slot i(type INTEGER))
 (slot j(type INTEGER)))

 (defglobal ?*LINES* = 24)
 (defglobal ?*COLUMNS* = 12)

 (deffacts initial
 (piece 0))

 (defrule choosePiece   
 =>
 (bind ?y (mod (random) 7)) //there are 7 pieces in Tetris game
 (assert (piece ?y)))

Random ルール choosePiece があり、そのルールの結果が 1 の場合、座標 (1,6) (1,7) (2,6) (2,7) のファクトに 1 つの正方形を追加します。 2 T を追加したいのですが、どうすればこれを作成し、それらのファクトの座標を変更してそれらのピースを移動できるようにするルールを作成できますか。ありがとう。

4

1 に答える 1