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;
publicrecordvaluePoint
{
public:
i32X;
i32Y;
new(i32X, i32Y);
}
Where(Point p) : str => p switch
{
(0, 0) => "origin",
Point(0, var y) => "on the Y axis at " + y,
(var x, 0) => "on the X axis at " + x,
{ X: > 0, Y: > 0 } => "first quadrant",
_ => "elsewhere",
};
Main()
{
Console.WriteLine(Where(newPoint(0, 0)));
Console.WriteLine(Where(newPoint(0, 5)));
Console.WriteLine(Where(newPoint(3, 0)));
Console.WriteLine(Where(newPoint(1, 2)));
Console.WriteLine(Where(newPoint(-1, 2)));
Console.WriteLine((1, "a") is (1, _));
}
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.