Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Cdalele
- def initialize(x,y, dx, dy)
- @x=x
- @y=y
- @dx=dx
- @dy=dy
- end
- def Suolis()
- @x+=rand(-@dx..@dx)
- @y+=rand(-@dy..@dy)
- puts "x = #{@x}, y = #{@y}"
- end
- end
- daleles=Array.new(20) {|i| i=Cdalele.new(50,50,5,5)}
- daleles[2].Suolis()
- for suolionr in 1..100
- puts "suolio numeris = #{suolionr}"
- for i in 0..19
- puts "i = #{i}"
- daleles[i].Suolis()
- end
- end
Add Comment
Please, Sign In to add comment