You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
578 B

  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. import sys
  4. sys.path.append('.')
  5. from example import Vector2, Vector
  6. v1 = Vector2(1, 2)
  7. v2 = Vector(3, -1)
  8. print("v1 = " + str(v1))
  9. print("v2 = " + str(v2))
  10. print("v1+v2 = " + str(v1+v2))
  11. print("v1-v2 = " + str(v1-v2))
  12. print("v1-8 = " + str(v1-8))
  13. print("v1+8 = " + str(v1+8))
  14. print("v1*8 = " + str(v1*8))
  15. print("v1/8 = " + str(v1/8))
  16. print("8-v1 = " + str(8-v1))
  17. print("8+v1 = " + str(8+v1))
  18. print("8*v1 = " + str(8*v1))
  19. print("8/v1 = " + str(8/v1))
  20. v1 += v2
  21. v1 *= 2
  22. print("(v1+v2)*2 = " + str(v1))