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;
publicclassVault
{
i32 code = 42; // private: before any labelpublic:
Peek(Vault other) : i32 => other.code;
inherited:
i32Level = 3;
friendly:
i32Shared = 5;
file:
i32Local = 6;
publici32Open = 7; // the word on the member wins
}
publicclassBigVault : Vault
{
public:
Show() : i32 => Level; // inherited: visible here
}
[FriendOf(Vault)]
publicclassAuditor
{
public:
Check(Vault v) : i32 => v.Shared; // friendly: Auditor is a friend
}
Main()
{
Vault v = newVault();
Console.WriteLine(v.Peek(v) + newBigVault().Show() + newAuditor().Check(v) + v.Local + v.Open);
}
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.