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/Fantom/hash-from-two-arrays.fantom
Normal file
16
Task/Hash-from-two-arrays/Fantom/hash-from-two-arrays.fantom
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class Main
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
keys := [1,2,3,4,5]
|
||||
values := ["one", "two", "three", "four", "five"]
|
||||
|
||||
// create an empty map
|
||||
map := [:]
|
||||
// add the key-value pairs to it
|
||||
keys.size.times |Int index|
|
||||
{
|
||||
map.add(keys[index], values[index])
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue