Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Hash-from-two-arrays/SNOBOL4/hash-from-two-arrays.sno
Normal file
16
Task/Hash-from-two-arrays/SNOBOL4/hash-from-two-arrays.sno
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
* # Fill arrays
|
||||
keys = array(5); vals = array(5)
|
||||
ks = 'ABCDE'; vs = '12345'
|
||||
kloop i = i + 1; ks len(1) . keys<i> = :s(kloop)
|
||||
vloop j = j + 1; vs len(1) . vals<j> = :s(vloop)
|
||||
|
||||
* # Create hash
|
||||
hash = table(5)
|
||||
hloop k = k + 1; hash<keys<k>> = vals<k> :s(hloop)
|
||||
|
||||
* # Test and display
|
||||
ts = 'ABCDE'
|
||||
tloop ts len(1) . ch = :f(out)
|
||||
str = str ch ':' hash<ch> ' ' :(tloop)
|
||||
out output = str
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue