我已经创建了一个套牌类,并且已经定义了在数组开头插入一个卡的函数之一。然而,每次我尝试在我的测试脚本中测试它时,我都会收到`add_to_bottom':错误的参数个数(1代表0)(ArgumentError)。有人能帮助我吗?我知道我已经接近了。在测试脚本中引用一个变量
甲板类
def add_to_bottom
@cards.insert(0, c)
end
测试脚本
d = Deck.new
c = Card.new(7, "S")
d.add_to_bottom(c)
print d, "\n"