Artificial intelligent assistant

Rubyで勝手にprivate method扱いされる gravityprivate '#' gravityprivate 2.3.1 * * * line = gets.chomp.split(' ') $W = line[0].to_i $H = line[1].to_i $N = line[2].to_i $sen = Array.new $H.times do $sen << gets.chomp.split("") end $sen.reverse! $sen = $sen.transpose def gravity # $sen.each do |y| y.delete('0') ($H-y.length).times do y << '0' end end end # $sen.gravity # p $sen

`gravity``undefined method`Ruby

`$sen.gravity``gravity`



* * *

main private

`gravity``main``$sen.gravity``undefined method``private method 'gravity' called`

KernelKernelObjectincludeObject


def m
p self.class
end

[].__send(:m) #=> Array
{}.__send(:m) #=> Hash
#

def hoge
puts "hoge"
end

class Hoge
def fuga
hoge
end
end

Hoge.new.fuga #=> "hoge"
Hoge.new.hoge #=> private method `hoge' called for # (NoMethodError)


* * *

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 09f31be9b9cce1e1c66d9e190b66a7ad