Someone
public text v1 · immutable# code:
class Lego
@count = 0
attr_reader :picks
def initialize( *picks )
if picks.uniq.length != 1
raise ArgumentError, "numbers not Identical"
end
@picks = picks
end
def self.new_random
new( rand( 25 ), rand( 25 ) )
rescue ArgumentError
@count += 1
retry
end
end
Lego.new_random
p Lego.@count
# output:
# randexp.rb:23: syntax error, unexpected tIVAR