undar-lang-fixed-length/test/malloc.ul

27 lines
393 B
Plaintext

/**
* Constants
*/
const str nl = "\n";
plex Terminal {
nat handle;
}
/**
* Main function
*/
function main() {
Terminal term = open("term::/0", 0);
pln(term, "Enter a string: ");
pln(term, term.read(32));
return 0;
}
/**
* Print with a newline
*/
function pln(Terminal term, str message) {
write(term, message, message.length);
write(term, nl, nl.length);
}