O?
Jump to navigation
Jump to search
- This is still a work in progress. It may be changed in the future.
this is a concept for a language made by InLuaIKnow
Examples
XKCD Random Number
function getRandomNumber():{
return 4; /# chosen by fair dice roll.
/# guaranteed to be random.
}
Hello, world!
using lib Program;
function Program.Main():{
Program.IO.Println("Hello, world!");
return 0;
};
Alternative
using lib Program;
namespaced Program.IO.Println println;
function Program.Main():{
println("Hello, world!");
return 0;
};
99 Bottles of Beer
using lib Program;
namespaced Program.IO.Println println;
function Program.Main():{
beers = 99;
while (beers>0):{
println(beers+" bottles of beer on the wall.");
println(beers+" bottles of beer.");
println("Take one down, pass it around,");
beers-=1;
};
println("No more bottles of beer on the wall,");
println("no more bottles of beer.");
println("Go to the store and buy some more,");
println("99 bottles of beer on the wall...");
return 0;
};
cat program
using lib Program;
namespaced Program.IO.Println println;
namespaced Program.IO.stdin.Read read;
function Program.Main():{
while (true):{
println(read("l>"));
};
return 0;
};