mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2abf156304
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
4 lines
297 B
Ruby
4 lines
297 B
Ruby
k1 = "Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong";
|
|
k2 = "Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping";
|
|
h = {k1 => 0, k2 => 0};
|
|
3000000.times{|i| k = i % 2 ? k2 : k1; h [k] = h[k] + 1}
|