35 lines
822 B
Plaintext
35 lines
822 B
Plaintext
constant A = {{27,"Jonah"},
|
|
{18,"Alan"},
|
|
{28,"Glory"},
|
|
{18,"Popeye"},
|
|
{28,"Alan"}},
|
|
B = {{"Jonah","Whales"},
|
|
{"Jonah","Spiders"},
|
|
{"Alan", "Ghosts"},
|
|
{"Alan", "Zombies"},
|
|
{"Glory","Buffy"}},
|
|
jA = 2,
|
|
jB = 1,
|
|
MB = new_dict()
|
|
sequence C = {}
|
|
for i=1 to length(B) do
|
|
object key = B[i][jB]
|
|
object data = getd(key,MB)
|
|
if data=0 then
|
|
data = {B[i]}
|
|
else
|
|
data = append(data,B[i])
|
|
end if
|
|
putd(key,data,MB)
|
|
end for
|
|
for i=1 to length(A) do
|
|
object data = getd(A[i][jA],MB)
|
|
if sequence(data) then
|
|
for j=1 to length(data) do
|
|
C = append(C,{A[i],data[j]})
|
|
end for
|
|
end if
|
|
end for
|
|
destroy_dict(MB)
|
|
pp(C,{pp_Nest,1})
|