Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Point
- {
- var x;
- var y;
- def Point(x, y)
- {
- this.x = x;
- this.y = y;
- }
- def to_string()
- {
- return ("[" + this.x.to_string() + ", " + this.y.to_string() + "]");
- }
- }
- /*
- Usage
- */
- var p = Point(13, 32);
- print(p.x.to_string());
- print(p.y.to_string());
- print(p.to_string());
- /*
- Output:
- >> 13
- >> 32
- >> [13, 32]
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement