diff options
| -rw-r--r-- | examples/cgol.sloth | 1 | ||||
| -rw-r--r-- | std/stdio.c | 8 | ||||
| -rw-r--r-- | std/stdio.sloth | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/examples/cgol.sloth b/examples/cgol.sloth index c4d9537..6cfe72d 100644 --- a/examples/cgol.sloth +++ b/examples/cgol.sloth @@ -98,6 +98,7 @@ fn main() Int { # Populate var life: [Int] = populate(); display(life); + curshide(); # Play forever while true { var new: [Int] = populate(); diff --git a/std/stdio.c b/std/stdio.c index d3ff5a0..f6dbeaf 100644 --- a/std/stdio.c +++ b/std/stdio.c @@ -18,3 +18,11 @@ void termpos(int x, int y) { void termclear() { printf("\x1b[2J\x1b[H"); } + +void curshide() { + print("\x1b[?25l"); +} + +void cursshow() { + print("\x1b[?25h"); +} diff --git a/std/stdio.sloth b/std/stdio.sloth index c28d474..77c9af0 100644 --- a/std/stdio.sloth +++ b/std/stdio.sloth @@ -1,6 +1,9 @@ foreign fn print(str: String) Void; foreign fn readln() String; +foreign fn curshide(); +foreign fn cursshow(); + fn println(str: String) Void { print(str); print("\n"); |
