Global Dim A.i(7) Global Dim B.i(7) Procedure.i MostarPos(N) Define.i M, I, R, C I = 7 While I >= 0 And A(I) > N I - 1 Wend If I < 0 : I = 0 : EndIf M = N + B(I) R = Int(M / 18) + 1 C = Mod(M, 18) + 1 PrintN("Atomic number " + RSet(Str(N), 3) + " -> " + Str(R) + ", " + RSet(Str(C), 2)) EndProcedure DataSection a: Data.i 1, 2, 5, 13, 57, 72, 89, 104 ; magic numbers b: Data.i -1, 15, 25, 35, 72, 21, 58, 7 elements: Data.i 1, 2, 29, 42, 57, 58, 59, 71, 72, 89, 90, 103, 113 EndDataSection If OpenConsole() Restore a For i = 0 To 7 Read.i A(i) Next Restore b For i = 0 To 7 Read.i B(i) Next Dim Element.i(12) Restore elements For i = 0 To 12 Read.i Element(i) Next For N = 0 To ArraySize(Element()) MostarPos(Element(N)) Next PrintN(#CRLF$ + "Press ENTER to exit"): Input() CloseConsole() EndIf