From 56e393f0497db54f962367e29757d2e862790897 Mon Sep 17 00:00:00 2001 From: Brieuc Dubois Date: Sat, 2 Mar 2024 09:38:48 +0100 Subject: [PATCH] cols function --- solution.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solution.pl b/solution.pl index 4ff6ff5..887296f 100644 --- a/solution.pl +++ b/solution.pl @@ -31,7 +31,9 @@ order as they were supplied to create table/2). If the given table does not exist, the predicate must throw a descriptive exception (use throw/1). */ -/* cols(Table, Cols). */ +cols(Table, Cols) :- + (tabl(Table, _) -> tabl(Table, Cols)); + throw("Table doesn't exist"). :- dynamic row/2. /*