Vector: Difference between revisions

Content added Content deleted
(Update Lang example: Use new operation parser syntax)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 3,413: Line 3,413:


=={{header|Wren}}==
=={{header|Wren}}==
<syntaxhighlight lang="ecmascript">class Vector2D {
<syntaxhighlight lang="wren">class Vector2D {
construct new(x, y) {
construct new(x, y) {
_x = x
_x = x
Line 3,462: Line 3,462:
{{libheader|Wren-vector}}
{{libheader|Wren-vector}}
Alternatively, using the above module and producing exactly the same output as before:
Alternatively, using the above module and producing exactly the same output as before:
<syntaxhighlight lang="ecmascript">import "./vector" for Vector2
<syntaxhighlight lang="wren">import "./vector" for Vector2


var v1 = Vector2.new(5, 7)
var v1 = Vector2.new(5, 7)