Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,34 @@
class Vector
declare x
declare y
def Vector(x, y)
this.x = float(x)
this.y = float(y)
end
def operator+(other)
return new(Vector, this.x + other.x, this.y + other.y)
end
def operator-(other)
return new(Vector, this.x - other.x, this.y - other.y)
end
def operator/(val)
return new(Vector, this.x / val, this.y / val)
end
def operator*(val)
return new(Vector, this.x * val, this.y * val)
end
def toString()
return format("[%s, %s]", this.x, this.y)
end
end
println new(Vector, 5, 7) + new(Vector, 2, 3)
println new(Vector, 5, 7) - new(Vector, 2, 3)
println new(Vector, 5, 7) * 11
println new(Vector, 5, 7) / 2