Skip to main content
fix
Source Link
hdrz
  • 1k
  • 6
  • 6

Pascal (FPC), 128 125 125138 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:int8);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ':2-i*j div 10);end;

Ungolfed:

procedure m(i, j: int8);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    m(i-1, j-1);
    writeln;
  end;
  m(i-1, j);
  write(i,'x',j,'=',i*j,' ':2-i*j div 10);
end;

Try it online! The reason for the byte count going up: the output was not aligned correctly. It is fixed now.

Try it online!

Pascal (FPC), 128 125 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:int8);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure m(i, j: int8);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    m(i-1, j-1);
    writeln;
  end;
  m(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;

Try it online!

Pascal (FPC), 128 125 138 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:int8);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ':2-i*j div 10);end;

Ungolfed:

procedure m(i, j: int8);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    m(i-1, j-1);
    writeln;
  end;
  m(i-1, j);
  write(i,'x',j,'=',i*j,' ':2-i*j div 10);
end;

The reason for the byte count going up: the output was not aligned correctly. It is fixed now.

Try it online!

added 306 characters in body
Source Link
hdrz
  • 1k
  • 6
  • 6

PascalPascal (FPC), 128128 125 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:integerint8);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure mulm(i, j: integerint8);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    mulm(i-1, j-1);
    writeln;
  end;
  mulm(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;

Try it online!

Pascal, 128 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:integer);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure mul(i, j: integer);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    mul(i-1, j-1);
    writeln;
  end;
  mul(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;

Pascal (FPC), 128 125 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:int8);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure m(i, j: int8);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    m(i-1, j-1);
    writeln;
  end;
  m(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;

Try it online!

added 20 characters in body
Source Link
hdrz
  • 1k
  • 6
  • 6

Pascal, 128 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:integer);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure mul(i, j: integer);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    mul(i-1, j-1);
    writeln;
  end;
  mul(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;

Pascal, 128 bytes

One recursive procedure takes care of everything.

procedure m(i,j:integer);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure mul(i, j: integer);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    mul(i-1, j-1);
    writeln;
  end;
  mul(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;

Pascal, 128 bytes

One recursive procedure takes care of everything. Call with m(9,9).

procedure m(i,j:integer);begin if i<1then Exit;if i=j then begin m(i-1,j-1);writeln;end;m(i-1,j);write(i,'x',j,'=',i*j,' ');end;

Ungolfed:

procedure mul(i, j: integer);
begin
  if i<1 then
    Exit;
  if i=j then
  begin
    mul(i-1, j-1);
    writeln;
  end;
  mul(i-1, j);
  write(i,'x',j,'=',i*j,' ');
end;
Source Link
hdrz
  • 1k
  • 6
  • 6
Loading