摘要:
一. 哈希变量(相当于Python中的字典) 详情参看:https://www.runoob.com/ruby/ruby-hash.html 1.值得注意的 (1). 创建Hash时需注意 # 创建一个空的Hash months = Hash.new puts months print(months 阅读全文
摘要:
一. 数组 1.定义一个数组 games = ["英雄联盟", "绝地求生", "钢铁雄心"] puts games 2.数组的循环 games.each do |geam| puts "玩《#{geam}》" end games.each_with_index do |game, index| p 阅读全文