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;
Main()
{
loop (i32 i = 5..=7)
Console.Write(i);
Console.WriteLine();
loop (i32 k = 0; k < 6; k += 2)
Console.Write(k);
Console.WriteLine();
loop (i64 j = 10)
{
if (j > 12)
break;
Console.Write(j);
}
Console.WriteLine();
List<i32> list = newList<i32>();
list.Add(4);
list.Add(5);
loop (i32 x in list)
Console.Write(x);
Console.WriteLine();
loop (u16 unit in"hey")
Console.Write(unit + " ");
Console.WriteLine();
i32 n = 1;
loop (n < 100)
n *= 3;
Console.WriteLine(n);
do
n -= 50;
loop (n > 0);
Console.WriteLine(n);
}
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.