Write Antril, run it in your browser and share it with a link. Programs are compiled to WebAssembly and run on your machine, not on the server.
Running programs is unavailable right now: the WebAssembly linker (wasm-ld, part of LLVM) is not installed on this server. You can still write, share and download code.
importSystem;
publicvaluePoint
{
public:
i32X;
i32Y;
new(i32X, i32Y);
Length2() : i32 => X * X + Y * Y;
Move(i32 dx) { X = X + dx; }
}
Main()
{
Point p = newPoint(3, 4);
Point q = p;
q.X = 0;
p.Move(1);
Console.WriteLine(p.Length2() + " " + q.Length2());
}
Output
Press Run (or Ctrl+Enter) to compile and run the program.
Input
What Console.ReadLine() reads, one line at a time.
Ctrl+Enter runs. Tab indents (Shift+Tab outdents); press Esc, then Tab, to leave the editor. A program may run for 10 seconds.