Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Periodic-table/XPL0/periodic-table.xpl0
Normal file
18
Task/Periodic-table/XPL0/periodic-table.xpl0
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
proc ShowPosn(N); \Show row and column for element
|
||||
int N, M, A, B, I, R, C;
|
||||
[A:= [ 1, 2, 5, 13, 57, 72, 89, 104]; \magic numbers
|
||||
B:= [-1, 15, 25, 35, 72, 21, 58, 7];
|
||||
I:= 7;
|
||||
while A(I) > N do I:= I-1;
|
||||
M:= N + B(I);
|
||||
R:= M/18 +1;
|
||||
C:= rem(0) +1;
|
||||
IntOut(0, N); Text(0, " -> ");
|
||||
IntOut(0, R); Text(0, ", ");
|
||||
IntOut(0, C); CrLf(0);
|
||||
];
|
||||
|
||||
int Element, I;
|
||||
[Element:= [1, 2, 29, 42, 57, 58, 72, 89, 90, 103];
|
||||
for I:= 0 to 10-1 do ShowPosn(Element(I));
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue