Last active
August 29, 2015 14:27
-
-
Save henriquebastos/32a3c3da1dfc5242a942 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
assert Vector(2, 4) | |
assert (Vector(2, 4).x, Vector(2, 4).y) == (2, 4) | |
assert repr(Vector(2, 4)) == 'Vector(2, 4)' | |
assert str(Vector(2, 4)) == '(2, 4)' | |
assert Vector(2, 4) == Vector(2, 4) | |
assert Vector(2, 4) + Vector(1, 2) == Vector(3, 6) | |
assert Vector(2, 4) * 2 == Vector(4, 8) | |
assert abs(Vector(3, 4)) == 5.0 | |
assert bool(Vector(0, 0)) == False | |
assert bool(Vector(0, 1)) == bool(Vector(1, 0)) == bool(Vector(1, 1)) | |
assert Vector(2, 2).dot(Vector(3, 4)) == 14 | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment