我一直在尝试制作游戏。游戏包括9件带点的游戏。该片的每个面都有0,1或2个点。
[2,2,0,0,1,0]
这是一件作品。这件作品,看起来像这样:
[[2,2,0,0,1,0], %%peca1
[2,1,0,0,1,1], %%peca2
[2,0,0,0,1,1], %%peca3
[2,0,0,0,0,0], %%peca4
[1,0,0,0,1,0], %%peca5
[1,0,0,0,0,0], %%peca6
[1,0,0,0,0,0], %%peca7
[0,0,0,0,1,0], %%peca8
[0,0,0,0,0,0]]), %%peca9
这些都是件。 (正面,右面,bacl,右,顶部,下面)
这是,当我运行它时,我收到消息
[V2,V5,V7,V11,V12,V16,V17,V18,V19,V23,V26,V29,V31,V35,V41,V47,V53] - singleton variables
任何帮助或建议?
致以最诚挚的问候,
Luis Costa
:-use_module(library(clpfd)).
dice:-
Vars=[V1, V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16, V17, V18,
V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30, V31, V32, V33, V34, V35, V36,
V37, V38, V39, V40, V41, V42, V43, V44, V45, V46, V47, V48, V49, V50, V51, V52, V53, V54],
domain(Vars,1,9),
table([
[V1, V2, V3, V4, V5, V6], %%peca1
[V7, V8, V9, V10, V11, V12], %%peca2
[V13, V14, V15, V16, V17, V18], %%peca3
[V19, V20, V21, V22, V23, V24], %%peca4
[V25, V26, V27, V28, V29, V30], %%peca5
[V31, V32, V33, V34, V35, V36], %%peca6
[V37, V38, V39, V40, V41, V42], %%peca7
[V43, V44, V45, V46, V47, V48], %%peca8
[V49, V50, V51, V52, V53, V54]], %%peca9
[[2,2,0,0,1,0], %%peca1
[2,1,0,0,1,1], %%peca2
[2,0,0,0,1,1], %%peca3
[2,0,0,0,0,0], %%peca4
[1,0,0,0,1,0], %%peca5
[1,0,0,0,0,0], %%peca6
[1,0,0,0,0,0], %%peca7
[0,0,0,0,1,0], %%peca8
[0,0,0,0,0,0]]), %%peca9
labeling([],Vars).
noDotsFace:-
sum([V2,V19, V7, V16, V31, V26],[V5, V23, V11, V53, V47, V41, V17, V35, V29, V18, V12], 7).