なんか遊んでるだけ
Rubyのクックブックとか読みたくなってきました.新しい刺激が欲しいぞ.
なんか,今日はこんな事して遊んでただけ.
class Stand def initialize print "Name:" @name = gets.chomp print "Stand:" @stand = gets.chomp print "Talk:" @talk = gets.chomp print "Last:" @last = gets.chomp end def attack a = rand(8) if a > 0 a.times{ print @talk } puts "!!!!" puts @last end end end $ irb irb(main):001:0> require 'stand' => true irb(main):002:0> jojo = Stand.new Name:空条承太郎 Stand:スタープラチナ Talk:オラ Last:やれやれだぜ => #<Stand:0x63290 @stand="\245\271\245\277\241\274\245\327\245\351\245\301\245\312", @last="\244\344\244\354\244\344\244\354\244\300\244\274", @name="\266\365\276\362\276\265\302\300\317\272", @talk="\245\252\245\351"> irb(main):003:0> jojo.attack オラオラオラオラオラオラオラ!!!! やれやれだぜ => nil
他にやる事無いのかYO!(ただclass定義したかっただけ)