最初のページ 戻る 次へ 最後のページ

solve(ANS,12).

choice([3,14,6,9],ANS),sum(ANS,12)

choice([3,14,6,9],ANS)

choice([14,6,9],ANS)

choice([6,9],ANS)

choice([9],ANS)

  ANS=[0]

choice([ ],ANS)

ANS=[ ]

choice([H|T],[0|Y]):-choice(T,Y).

Y=[ ], ANS=[0|Y]

T=Y=[ ]

巻取り段階