Menu

[r350]: / XTABLE.MPL  Maximize  Restore  History

Download this file

19 lines (12 with data), 320 Bytes

// JUST ONE OF MANY WAYS TO IMPLEMENT TABLES IN MPL

##LIBHDR

.SIZE:8

TAB=0 TAB.ROW(Y) TAB!(Y*.SIZE)$

.(;X,Y) [
  TAB=VNEW(*.SIZE);
  X=-1; ++X<.SIZE @ [ Y=-1; ++Y<.SIZE @ TAB.ROW(Y)!X=X*Y ];
  X=-1; ++X<.SIZE @ [
    Y=-1; ++Y<.SIZE @ WRITEF("%Nx%N=%I2 ",X,Y,TAB.ROW(Y)!X);
    NEWLINE()
  ];
0]

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.