Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -0,0 +1,31 @@
|
|||
dim p(7)
|
||||
dim p$(7)
|
||||
p$[0] = "Payload#0" : p$[1] = "Payload#1"
|
||||
p$[2] = "Payload#2" : p$[3] = "Payload#3"
|
||||
p$[4] = "Payload#4" : p$[5] = "Payload#5"
|
||||
p$[6] = "Payload#6"
|
||||
dim q(7) fill false
|
||||
dim t(4, 5)
|
||||
t[0, 0] = 1: t[0, 1] = 2
|
||||
t[1, 0] = 3: t[1, 1] = 4: t[1, 2] = 1
|
||||
t[2, 0] = 5
|
||||
|
||||
for i = 0 to t[?][]-1
|
||||
for j = 0 to t[?][]-1
|
||||
if t[i, j] <> 0 then
|
||||
q[t[i, j]] = true
|
||||
t[i, j] += 1
|
||||
end if
|
||||
next j
|
||||
next i
|
||||
|
||||
for i = 0 to t[?][]-1
|
||||
for j = 0 to t[?][]-1
|
||||
if t[i, j] <> 0 then print p$[t[i, j] -1]; " ";
|
||||
next j
|
||||
print
|
||||
next i
|
||||
|
||||
for i = 0 to q[?]-1
|
||||
if not q[i] then print p$[i]; " is not used"
|
||||
next i
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
100 cls
|
||||
110 dim i,j,p(6)
|
||||
120 dim p$(6)
|
||||
130 p$(0) = "Payload#0" : p$(1) = "Payload#1"
|
||||
140 p$(2) = "Payload#2" : p$(3) = "Payload#3"
|
||||
150 p$(4) = "Payload#4" : p$(5) = "Payload#5"
|
||||
160 p$(6) = "Payload#6"
|
||||
170 dim q(6)
|
||||
180 dim t(2,3)
|
||||
190 t(0,0) = 1 : t(0,1) = 2
|
||||
200 t(1,0) = 3 : t(1,1) = 4 : t(1,2) = 1
|
||||
210 t(2,0) = 5
|
||||
220 for i = 0 to ubound(t)
|
||||
230 for j = 0 to ubound(t,2)
|
||||
240 if t(i,j) <> 0 then
|
||||
250 q(t(i,j)) = true
|
||||
260 t(i,j) = t(i,j)+1
|
||||
270 endif
|
||||
280 next j
|
||||
290 next i
|
||||
300 for i = 0 to ubound(t)
|
||||
310 for j = 0 to ubound(t,2)
|
||||
320 if t(i,j) <> 0 then print p$(t(i,j)-1);" ";
|
||||
330 next j
|
||||
340 print
|
||||
350 next i
|
||||
360 for i = 0 to ubound(q)
|
||||
370 if not q(i) then print p$(i);" is not used"
|
||||
380 next i
|
||||
390 end
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
Dim As Integer t(2, 3) = {{1,2},{3,4,1},{5}}
|
||||
Dim As Integer i, j, p(6)
|
||||
Dim As String pStr(6) = {"Payload#0", "Payload#1", "Payload#2", "Payload#3", "Payload#4", "Payload#5", "Payload#6"}
|
||||
Dim As Boolean q(6)
|
||||
|
||||
For i = Lbound(t) To Ubound(t)
|
||||
For j = Lbound(t, 2) To Ubound(t, 2)
|
||||
If t(i, j) <> 0 Then
|
||||
q(t(i, j)) = True
|
||||
t(i, j) += 1
|
||||
End If
|
||||
Next j
|
||||
Next i
|
||||
|
||||
For i = Lbound(t) To Ubound(t)
|
||||
For j = Lbound(t, 2) To Ubound(t, 2)
|
||||
If t(i, j) <> 0 Then Print pStr(t(i, j)-1); " ";
|
||||
Next j
|
||||
Print
|
||||
Next i
|
||||
|
||||
For i = Lbound(q) To Ubound(q)
|
||||
If q(i) = False Then Print pStr(i); " is not used"
|
||||
Next i
|
||||
|
||||
Sleep
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
110 TRUE = -1
|
||||
120 FALSE = NOT TRUE
|
||||
130 DIM I,J,P(6)
|
||||
140 DIM P$(6)
|
||||
150 P$(0) = "Payload#0" : P$(1) = "Payload#1"
|
||||
160 P$(2) = "Payload#2" : P$(3) = "Payload#3"
|
||||
170 P$(4) = "Payload#4" : P$(5) = "Payload#5"
|
||||
180 P$(6) = "Payload#6"
|
||||
190 DIM Q(6)
|
||||
200 DIM T(2,3)
|
||||
210 T(0,0) = 1 : T(0,1) = 2
|
||||
220 T(1,0) = 3 : T(1,1) = 4 : T(1,2) = 1
|
||||
230 T(2,0) = 5
|
||||
240 FOR I = 0 TO 2
|
||||
250 FOR J = 0 TO 3
|
||||
260 IF T(I,J) <> 0 THEN Q(T(I,J)) = TRUE : T(I,J) = T(I,J)+1
|
||||
270 NEXT J
|
||||
280 NEXT I
|
||||
290 FOR I = 0 TO 2
|
||||
300 FOR J = 0 TO 3
|
||||
310 IF T(I,J) <> 0 THEN PRINT P$(T(I,J)-1);" ";
|
||||
320 NEXT J
|
||||
330 PRINT
|
||||
340 NEXT I
|
||||
350 FOR I = 0 TO 6
|
||||
360 IF Q(I) = FALSE THEN PRINT P$(I);" is not used"
|
||||
370 NEXT I
|
||||
380 END
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
True = -1: False = NOT True
|
||||
|
||||
DIM p(6)
|
||||
DIM p$(6)
|
||||
p$(0) = "Payload#0": p$(1) = "Payload#1"
|
||||
p$(2) = "Payload#2": p$(3) = "Payload#3"
|
||||
p$(4) = "Payload#4": p$(5) = "Payload#5"
|
||||
p$(6) = "Payload#6"
|
||||
DIM q(6)
|
||||
DIM t(2, 3)
|
||||
t(0, 0) = 1: t(0, 1) = 2
|
||||
t(1, 0) = 3: t(1, 1) = 4: t(1, 2) = 1
|
||||
t(2, 0) = 5
|
||||
|
||||
FOR i = LBOUND(t) TO UBOUND(t) '0 To 2
|
||||
FOR j = LBOUND(t, 2) TO UBOUND(t, 2) '0 To 3
|
||||
IF t(i, j) <> 0 THEN
|
||||
q(t(i, j)) = True
|
||||
t(i, j) = t(i, j) + 1
|
||||
END IF
|
||||
NEXT j
|
||||
NEXT i
|
||||
|
||||
FOR i = LBOUND(t) TO UBOUND(t) '0 To 2
|
||||
FOR j = LBOUND(t, 2) TO UBOUND(t, 2) '0 To 3
|
||||
IF t(i, j) <> 0 THEN PRINT p$(t(i, j) - 1); " ";
|
||||
NEXT j
|
||||
PRINT
|
||||
NEXT i
|
||||
|
||||
FOR i = LBOUND(q) TO UBOUND(q)
|
||||
IF q(i) = False THEN PRINT p$(i); " is not used"
|
||||
NEXT i
|
||||
17
Task/Nested-templated-data/Refal/nested-templated-data.refal
Normal file
17
Task/Nested-templated-data/Refal/nested-templated-data.refal
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
$ENTRY Go {
|
||||
, (((1 2) (3 4 1) 5)): e.Template
|
||||
, "Payload#0" "Payload#1" "Payload#2" "Payload#3"
|
||||
"Payload#4" "Payload#5" "Payload#6": e.Payload
|
||||
= <Prout <Subst (e.Payload) e.Template>>;
|
||||
};
|
||||
|
||||
Subst {
|
||||
(e.P) = ;
|
||||
(e.P) s.I e.X = <Item s.I e.P> <Subst (e.P) e.X>;
|
||||
(e.P) (e.X) e.Y = (<Subst (e.P) e.X>) <Subst (e.P) e.Y>;
|
||||
};
|
||||
|
||||
Item {
|
||||
0 t.I e.X = t.I;
|
||||
s.N t.I e.X = <Item <- s.N 1> e.X>;
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
DIM p(6)
|
||||
DIM p$(6)
|
||||
p$(0) = "Payload#0": p$(1) = "Payload#1"
|
||||
p$(2) = "Payload#2": p$(3) = "Payload#3"
|
||||
p$(4) = "Payload#4": p$(5) = "Payload#5"
|
||||
p$(6) = "Payload#6"
|
||||
DIM q(6)
|
||||
DIM t(2, 3)
|
||||
t(0, 0) = 1: t(0, 1) = 2
|
||||
t(1, 0) = 3: t(1, 1) = 4: t(1, 2) = 1
|
||||
t(2, 0) = 5
|
||||
|
||||
FOR i = 0 TO 2
|
||||
FOR j = 0 TO 3
|
||||
IF t(i, j) <> 0 THEN
|
||||
q(t(i, j)) = -1
|
||||
t(i, j) = t(i, j) + 1
|
||||
END IF
|
||||
NEXT j
|
||||
NEXT i
|
||||
|
||||
FOR i = 0 TO 2
|
||||
FOR j = 0 TO 3
|
||||
IF t(i, j) <> 0 THEN PRINT p$(t(i, j) - 1); " ";
|
||||
NEXT j
|
||||
PRINT
|
||||
NEXT i
|
||||
|
||||
FOR i = 0 TO 6
|
||||
IF q(i) = 0 THEN PRINT p$(i); " is not used"
|
||||
NEXT i
|
||||
21
Task/Nested-templated-data/SETL/nested-templated-data.setl
Normal file
21
Task/Nested-templated-data/SETL/nested-templated-data.setl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
program substitution;
|
||||
template := [[[1,2],[3,4,1],5]];
|
||||
payload := {
|
||||
[0,"Payload#0"], [1,"Payload#1"], [2,"Payload#2"], [3,"Payload#3"],
|
||||
[4,"Payload#4"], [5,"Payload#5"], [6,"Payload#6"]
|
||||
};
|
||||
|
||||
print(subst(template, payload));
|
||||
|
||||
proc subst(template, payload);
|
||||
if not is_tuple(template) then
|
||||
return(payload(template));
|
||||
end if;
|
||||
|
||||
result := [];
|
||||
loop for item in template do
|
||||
result with:= subst(item, payload);
|
||||
end loop;
|
||||
return result;
|
||||
end proc;
|
||||
end program;
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
dim p(6)
|
||||
dim p$(6)
|
||||
p$(0) = "Payload#0" : p$(1) = "Payload#1"
|
||||
p$(2) = "Payload#2" : p$(3) = "Payload#3"
|
||||
p$(4) = "Payload#4" : p$(5) = "Payload#5"
|
||||
p$(6) = "Payload#6"
|
||||
dim q(6)
|
||||
dim t(2, 3)
|
||||
t(0, 0) = 1: t(0, 1) = 2
|
||||
t(1, 0) = 3: t(1, 1) = 4: t(1, 2) = 1
|
||||
t(2, 0) = 5
|
||||
|
||||
for i = 0 to arraysize(t(), 1)
|
||||
for j = 0 to arraysize(t(), 2)
|
||||
if t(i, j) <> 0 then
|
||||
q(t(i, j)) = True
|
||||
t(i, j) = t(i, j) + 1
|
||||
fi
|
||||
next j
|
||||
next i
|
||||
|
||||
for i = 0 to arraysize(t(), 1)
|
||||
for j = 0 to arraysize(t(), 2)
|
||||
if t(i, j) <> 0 print p$(t(i, j) -1), " ";
|
||||
next j
|
||||
print
|
||||
next i
|
||||
|
||||
for i = 0 to arraysize(q(), 1)
|
||||
if not q(i) print p$(i), " is not used"
|
||||
next i
|
||||
Loading…
Add table
Add a link
Reference in a new issue