From b1d29cd6fe5dc2a8deb815d162c878f61966bf82 Mon Sep 17 00:00:00 2001 From: Brian Barto Date: Mon, 11 Apr 2016 16:14:02 -0400 Subject: [PATCH] Initial display of the characters via "type effect" modified: src/nms.c --- src/nms.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nms.c b/src/nms.c index 47ac4f7..f3559a0 100644 --- a/src/nms.c +++ b/src/nms.c @@ -86,10 +86,20 @@ int main(void) { clearTermWindow(termSizeRows, termSizeCols); - // TODO: Data should initially 'type' itself on to the screen + // Initially display the characters in the terminal with a 'type effect'. + ms = 5; // miliseconds, used for usleep() + list_pointer = start; + while (list_pointer != NULL && list_pointer->row <= termSizeRows) { + printf("\033[%i;%iH%c", list_pointer->row, list_pointer->col, list_pointer->mask); + list_pointer->mask = getMaskChar(); + list_pointer = list_pointer->next; + fflush(stdout); + usleep(ms * 1000); + } // TODO: pause with getchar() - something about the input stream being redirected // to a file is causing getchar() to immediately return here. + sleep(1); // Jumble loop ms = 35; // miliseconds, used for usleep()