【发布时间】:2017-01-22 15:50:20
【问题描述】:
class Place
@description = "Default place"
def initialize(x : Int32, y : Int32, description : String)
@x = x
@y = y
@description = description
puts "Description of this place is: #{description}"
end
end
require "./browser-game/*"
require "./places/*"
module Browser::Game
# TODO Put your code here
place = Place.new 2, 3, "Yay new description"
puts place.description
puts "End of the program"
end
我收到此错误:
browser-game.cr:8 中的错误:Place 的未定义方法“描述”
puts place.description ^~~~~~~~~~~
【问题讨论】:
-
我喜欢你的编码设置
-
@LucaAngioloni 谢谢!强烈推荐适用于 Mac 的 Cathode 终端应用程序,带有 Alien 的声音(第一部电影)
标签: crystal-lang