#INCLUDE "course.module"

PROC main(CHAN BYTE kyb?, scr!, err!)
  MOBILE []MOBILE []INT x:
  SEQ
    x := MOBILE [2]MOBILE []INT
    SEQ i = 0 FOR SIZE x
      SEQ
        x[i] := MOBILE [10]INT

        out.string ("SIZE x[", 0, scr!)
        out.int (i, 0, scr!)
        out.string ("] = ", 0, scr!)
        out.int (SIZE x[i], 0, scr!)
        scr ! '*n'

        SEQ j = 0 FOR SIZE x[i]
          VAL INT y IS ((i + 1) * (j + 1)) * (42 * ((i + 7) * 42)):
          SEQ
            scr ! #FF
            out.int (i, 0, scr!)
            scr ! 'x'
            out.int (j, 0, scr!)
            out.string (" := ", 0, scr!)
            out.int (y, 0, scr!)
            scr ! '*n'

            x[i][j] := y

            out.string ("done*n", 0, scr!)

    SEQ i = 0 FOR SIZE x
      SEQ j = 0 FOR SIZE x[i]
        VAL INT y IS ((i + 1) * (j + 1)) * (42 * ((i + 7) * 42)):
        SEQ
          out.int (i, 0, scr!)
          scr ! 'x'
          out.int (j, 0, scr!)
          out.string (" = ", 0, scr!)
          out.int (x[i][j], 0, scr!)
          out.string (" (", 0, scr!)
          out.int (y, 0, scr!)
          out.string (")*n", 0, scr!)
          scr ! #FF

          ASSERT (x[i][j] = y)
:
