Advertisement
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)
- print "x=", @x, "y=", @y, "\n"
- end
- end
- dalele = Cdalele.new(5,10,1,1)
- dalele.suolis()
- dalele.suolis()
- dalele.suolis()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement