I have a Prolog project to create about the "Puzzle 8". I'm new with this language. I have many doubts so I came here to resolve at least one. Here is my code:
puzzle([1, 2, 3, 4, 5, 6, 7, 8, 0]).
affiche_puzzle :-
puzzle(Puzzle),
printe(Puzzle).
printe([]).
printe([H1,H2,H3|Puzzle]) :-
format('~w ~w ~w~n', [H1, H2, H3]),
printe(Puzzle).
My doubt is why when I use the printe([H1,H2,H3|Puzzle]) the result is this and not the numbers of the list:
_G4716 _G4719 _G4722
Puzzle = [] ;
_G4843 _G4846 _G4849
Puzzle = [_G4843, _G4846, _G4849]...
I would be grateful if you help me!