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;
intonamespacePalette
{
publicenumSize { Small, Medium = 5, Large }
publicenumWord : str { Hello = "hola", World }
publicbitflagenumAccess : u8 { Read, Write, Execute, All = declbits }
publicrecordvalueRgb
{
public:
u8R;
u8G;
u8B;
new(u8R, u8G, u8B);
}
publicenumColor : Rgb
{
Red = newRgb(255, 0, 0),
Green = newRgb(0, 255, 0),
}
Main()
{
Size s = Size.Large;
Console.WriteLine(s + " is " + (i32)s);
Console.WriteLine((str)Word.Hello + " " + (str)Word.World);
Access a = Access.Read | Access.Write;
Console.WriteLine((a & Access.Write) == Access.Write);
Console.WriteLine(a.HasFlag(Access.Execute));
Console.WriteLine((u8)Access.All);
Rgb green = (Rgb)Color.Green;
Console.WriteLine(green);
}
}
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.