Matrix with two diagonals: Difference between revisions

→‎{{header|ALGOL 68}}: Slight simplification
(Added Algol 68)
(→‎{{header|ALGOL 68}}: Slight simplification)
Line 10:
PROC draw 2 diagonals = ( INT n )VOID:
BEGIN
CHAR set INT l pos := "1";
CHARINT resetr pos := "0"n;
INT l pos := 1;
INT r pos := n;
FOR i TO n DO
FOR j TO n DO
print( ( " ", IFwhole( ABS ( j = l pos OR j = rpos THEN set ELSE), reset0 FI) ) )
OD;
print( ( newline ) );
3,038

edits