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;
intonamespaceGeometry
{
publicvalueSize
{
public:
i32Width;
i32Height;
// No body: each parameter is stored in the field of the same name.new(i32Width, i32Height);
// Calls the other constructor.new(i32 side) : (side, side);
i32Area { get => Width * Height; }
}
publicclassLabel
{
readonlystr text;
public:
new(str text) { this.text = text; }
overrideToString() : str => "[" + text + "]";
}
Main()
{
Size square = newSize(4);
Console.WriteLine(square.Area);
Console.WriteLine(newLabel("ok"));
}
}
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.