Re: Tutorial on sequences
Karlheinz Nester wrote:
>
> Hi to any Euphorian who knows a lot about sequences,
>
> I like to add a sequence (append) to another sequence.
> For example :
> given :
> seq1 = {{1,2,3,4},{5,6,7,8},{9,10,11,12}}
> seq2 = {20,30,40}
> result should be:
> seq1 = {{1,2,3,4,20},{5,6,7,8,30},{9,10,11,12,40}}
>
> How can this be done without much overhead ??
> I believe it is easy,but I can't get it.
>
> TIA Karlheinz
>
sequence seq1, seq2
seq1 = {{1,2,3,4},{5,6,7,8},{9,10,11,12}}
seq2 = {20,30,40}
for i = 1 to length(seq1) do
seq1[i] = append(seq1[i],seq2[i])
end for
puts(1,"{{1,2,3,4,20},{5,6,7,8,30},{9,10,11,12,40}} -- desired
result\n")
print(1,seq1)
puts(1," -- actual result")
Regards,
Irv
|
Not Categorized, Please Help
|
|