Ok i got these two predicated hangman and graphics
fail([]).
hangman:-
getPhrase(Ans),
!,
write('Welcome to hangman.'),
nl,
fail(FailedList),
graphics(FailedList), %<--- The call is made here.
name(Ans,AnsList),
makeBlanks(AnsList, BlankList),
getGuess(AnsList,BlankList, FailedList).
graphics(FailedList):-
length(FailedList, L),
L == 0,
write('-----------'), nl,
write('|'), nl,
write('|'), nl,
write('|'), nl,
write('|'), nl,
write('|'), nl,
write('|'), nl,
write('|'), nl,
write('|'), nl,
write('/\'), nl.
Why do i get the error: ERROR: hangman/0: Undefined procedure: graphics/1?
Note that if i put the predicate graphics inside hangman in comments my program works fine.
In the last line, you are escaping the ending quotation mark with
\'. Change it to:BTW: @Mog has written the answer before I had a look at the comments, I tested it and now it finds graphics/1.