Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const std = require("tstl");
- class Point
- {
- constructor(x = Math.random() * 100, y = Math.random() * 100, z = Math.random() * 100)
- {
- this.x = x;
- this.y = y;
- }
- less(obj)
- {
- if (this.x === obj.x)
- return this.y < obj.y;
- else
- return this.x < obj.x;
- }
- }
- function main()
- {
- let set = new std.TreeSet();
- for (let i = 0; i < 10; ++i)
- set.insert(new Point());
- for (let p of set)
- console.log(p);
- }
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement