old-trainOS/scripts/main.ts

28 lines
400 B
TypeScript
Raw Normal View History

VAR global : INT;
# OBJ timer : "/sys/timer";
# OBJ heap : "/sys/malloc";
# OBJ interrupts : "/sys/interrupt";
PUB main() | i : INT, str : TEXT
BEGIN
0 -> i;
"Hello " -> str;
printStr(str + "World!");
WHILE ((i + 1) -> i) <= fun() DO
2015-08-15 22:45:12 +00:00
BEGIN
hlp(i, fun() - i);
sleep(2);
2015-08-15 22:45:12 +00:00
END
END
PRI hlp(i : INT, j : INT)
BEGIN
print2Int(i, j);
END
2015-08-14 15:12:08 +00:00
PUB fun() -> i : INT
BEGIN
60 -> i;
END