⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Backport187
All Projects
Ruby
»
Backport187
Overview
Activity
Issues
Like
Download (277 Bytes)
Bug #2006
» bug1.rb
bug1.rb -
totoro (Alan Stebbens)
, 08/27/2009 01:32 PM
#!/usr/bin/env ruby
h
=
Hash
.
new
[
0
,
0
]
d
=
[
'a'
,
'b'
,
'c'
]
puts
h
d
.
each_with_index
{
|
k
,
x
|
h
[
k
][
0
]
+=
x
h
[
k
][
1
]
-=
x
}
puts
"h.inspect =
#{
h
.
inspect
}
"
puts
"h.keys =
#{
h
.
keys
.
inspect
}
"
puts
"h.values =
#{
h
.
values
.
inspect
}
"
d
.
each
{
|
k
|
puts
"
#{
k
}
=
#{
h
[
k
].
inspect
}
"
}
« Previous
1
2
Next »
(1-1/2)
Loading...