From 9de291f188f126e7b6b689e9f718604402e6ad43 Mon Sep 17 00:00:00 2001 From: Tiehuis Date: Fri, 14 Mar 2014 14:19:37 +1300 Subject: [PATCH] Changed print function so it draws the correct border lengths on any grid size --- 2048_no_curses.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/2048_no_curses.c b/2048_no_curses.c index 083ac32..364dfbd 100644 --- a/2048_no_curses.c +++ b/2048_no_curses.c @@ -182,8 +182,8 @@ void draw_grid() printf("\n"); // alter this SZ + 1 to match abitrary grid size - ITER(SZ + 1, printf("-----")); - printf("\n"); + ITER(SZ, printf("------")); + printf("-\n"); int i, j; for (i = 0; i < SZ; i++) { printf("|"); @@ -195,8 +195,8 @@ void draw_grid() } printf("\n"); } - ITER(SZ + 1, printf("-----")); - printf("\n\n"); + ITER(SZ, printf("------")); + printf("-\n\n"); } /* store the terminal settings and call this function on exit to restore */ @@ -248,7 +248,7 @@ int main(int argc, char **argv) } /* random seed */ - srand(time(NULL)); + srand((unsigned int)time(NULL)); ITER(2, rand_block()); draw_grid();