Escribe Antril, ejecútalo en tu navegador y compártelo con un enlace. Los programas se compilan a WebAssembly y se ejecutan en tu equipo, no en el servidor.
Ejecutar programas no está disponible en este momento: the WebAssembly linker (wasm-ld, part of LLVM) is not installed on this server. Aún puedes escribir, compartir y descargar código.
importSystem;
intonamespaceValues
{
publicvaluePoint
{
public:
i32X;
i32Y;
new(i32 x, i32 y) { X = x; Y = y; }
Move(i32 dx) { X = X + dx; }
}
publicfinalclassLabel
{
Point at;
i32? width;
fixedu8[] text;
public:
new(i32 length) : fixed(length) { width = null; }
Size() : i32 => text.Length;
}
Main()
{
Point p = newPoint(1, 2);
p.Move(3);
Console.WriteLine(p.X);
Console.WriteLine(newLabel(5).Size());
}
}
Salida
Pulsa Ejecutar (o Ctrl+Enter) para compilar y ejecutar el programa.
Entrada
Lo que lee Console.ReadLine(), una línea a la vez.
Ctrl+Enter ejecuta. Tab agrega sangría (Shift+Tab la quita); pulsa Esc y luego Tab para salir del editor. Un programa puede ejecutarse durante 10 segundos.