开始我的河内塔任务,我有
a = [6,5,4,3,2,1]
b = []
c = []
puts "Type a, b, or c"
from = gets.chomp
# the user types a lower-case a
popped = from.pop
现在这显然失败了,因为 pop 不是字符串方法。
所以除了
if from == a
popped = a.pop
elsif from == b
popped = b.pop
,是否有一个不错的红宝石快捷方式来获得我想要的流行音乐?