Code to be explained

Yes, and the output part of this can be simplified even further to

for I in 1 .. Lines loop
   Ada.Text_IO.Put_Line (Item => (1 .. I => '+') );
end loop;

which is even clearer. This was shown to the OP in this post, so perhaps there is some unstated reason for taking the more complex, unclear approach.

1 Like