This file contains 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
import 'dart:math'; | |
addv(v1, v2){ | |
return [v1[0]+v2[0],v1[1]+v2[1]]; | |
} | |
subv(v1,v2){ | |
return [v1[0]-v2[0],v1[1]-v2[1]]; | |
} |
This file contains 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
import 'dart:html'; | |
void main() { | |
Vec2 p1=new Vec2(50,50); | |
Vec2 p2=new Vec2(100,50); | |
Vec2 p3=new Vec2(100,100); | |
Vec2 p4=new Vec2(50,100); | |
HtmlCanvas canvas = new HtmlCanvas("#canvas") |
This file contains 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
shared alias Vec2 => [Integer,Integer]; | |
shared alias Vec2List => CycleList<Vec2>; | |
Integer x = 0; | |
Integer y = 1; | |
shared class CycleListNode<T>(nodeValue,prev=null,next=null) { | |
shared variable T nodeValue; | |
shared variable CycleListNode<T>? prev; |
NewerOlder