r/prolog • • Jun 23 '21

Why my code doesn't work?

It returns me false every time I try.

table:-[[#,#,#,#,#,#,#,#,#],[#,@,' ',' ',$,' ',' ',.,#],[#,#,#,#,#,#,#,#,#]].

print_table([]).
print_table([A|B]):-format("~w~w~w~w~w~w~w~w~w",A),nl,print_table(B).

main:-
print_table(table).
0 Upvotes

2 comments sorted by

1

u/Sondeyyy Jun 23 '21

print_row isn't defined

1

u/Money_Juice_4717 Jun 23 '21

I'm sorry, that was a failure while writing it