From 0726b60a6e32760fbadd1cdd39362c9c7a0fd9cc Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 8 Apr 2018 17:29:30 -0400 Subject: file loading, switching, good! --- initrd/boot | 3 --- initrd/calc | 8 ++++++++ initrd/init | 12 +++++++----- initrd/keys | 11 ++++++----- initrd/lines | 3 +++ 5 files changed, 24 insertions(+), 13 deletions(-) delete mode 100644 initrd/boot create mode 100644 initrd/calc (limited to 'initrd') diff --git a/initrd/boot b/initrd/boot deleted file mode 100644 index 13e5876..0000000 --- a/initrd/boot +++ /dev/null @@ -1,3 +0,0 @@ -choice = filemenu -print("\nChoice: ") -print(choice) diff --git a/initrd/calc b/initrd/calc new file mode 100644 index 0000000..7359f16 --- /dev/null +++ b/initrd/calc @@ -0,0 +1,8 @@ +while (1) { + print("> ") + input = gets() + answer = solve(input) + print("\n") + print(answer) + print("\n") +} diff --git a/initrd/init b/initrd/init index 7359f16..6c5acac 100644 --- a/initrd/init +++ b/initrd/init @@ -1,8 +1,10 @@ while (1) { - print("> ") - input = gets() - answer = solve(input) - print("\n") - print(answer) + rect(0, 0, 480, 320, 0) + ppos(0, 0) + + print("Free mem: ") + print(freemem()) print("\n") + choice = filemenu() + program(choice) } diff --git a/initrd/keys b/initrd/keys index 47dbae1..b5b4dfc 100644 --- a/initrd/keys +++ b/initrd/keys @@ -1,8 +1,9 @@ -do - getkey > input - print input - delay 1000 -while (1) +while (1) { + input = getkey() + print(input) + print("\n") + delay(1000) +} #do # getkey > input diff --git a/initrd/lines b/initrd/lines index f6b2a82..8523339 100644 --- a/initrd/lines +++ b/initrd/lines @@ -26,4 +26,7 @@ while (1) { j = 50 + rand(219) line(x, y, i, j, 511) + + # for exiting + getkey() } -- cgit v1.2.3