Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Vector/Groovy/vector-2.groovy
Normal file
16
Task/Vector/Groovy/vector-2.groovy
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Number.metaClass.mixin VectorCategory
|
||||
|
||||
def a = [1, 5] as Vector
|
||||
def b = [6, -2] as Vector
|
||||
def x = 8
|
||||
println "a = $a b = $b x = $x"
|
||||
assert a + b == [7, 3] as Vector
|
||||
println "a + b == $a + $b == ${a+b}"
|
||||
assert a - b == [-5, 7] as Vector
|
||||
println "a - b == $a - $b == ${a-b}"
|
||||
assert a * x == [8, 40] as Vector
|
||||
println "a * x == $a * $x == ${a*x}"
|
||||
assert x * a == [8, 40] as Vector
|
||||
println "x * a == $x * $a == ${x*a}"
|
||||
assert b / x == [3/4, -1/4] as Vector
|
||||
println "b / x == $b / $x == ${b/x}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue