%% 2 %% width1([x,x,x],Width). %% Width = 3 width1(Line,Width) :- width2(Line,0,Width). width2(Line,Width1,Width2) :- Line = [_Item | Items], Width3 is Width1 + 1, width2(Items,Width3,Width2). width2([], Width, Width).