Advertisement
Qpel

Untitled

Mar 13th, 2018
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.26 KB | None | 0 0
  1. class Cdalele
  2.     def initialize(x,y,dx,dy)
  3.     @x=x
  4.     @y=y
  5.     @dx=dx
  6.     @dy=dy
  7. end
  8. def suolis()
  9.     @x+=rand(-@dx..@dx)
  10.     @y+=rand(-@dy..@dy)
  11.     print "x=", @x, "y=", @y, "\n"
  12.     end
  13. end
  14. dalele = Cdalele.new(5,10,1,1)
  15. dalele.suolis()
  16. dalele.suolis()
  17. dalele.suolis()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement