Skip to content

Instantly share code, notes, and snippets.

@kimihito
Created June 20, 2012 12:42
Show Gist options
  • Save kimihito/2959711 to your computer and use it in GitHub Desktop.
Save kimihito/2959711 to your computer and use it in GitHub Desktop.
たのしいRuby11章
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
a = Array.new
100.times do |i|
a << i + 1
end
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
a = Array.new
100.times do |i|
a << i + 1
end
p a[2]
a2 = Array.new
100.times do |i|
a2 << a[i] * 100
end
p a2[2]
100.times do |i|
a[i] *= 100
end
p a[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment