From 78ae4bb292b97b0be007bf584ef5b83bc81a3dc1 Mon Sep 17 00:00:00 2001 From: SashaPGT Date: Sun, 21 Nov 2021 22:19:44 +0700 Subject: [PATCH] Crash fixes --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index e5bc10f..744fd99 100644 --- a/main.cpp +++ b/main.cpp @@ -451,7 +451,7 @@ int game(){ clock_t start_t,this_t,start; start_t=clock(); start=start_t; - int posX[100],posY[100],fruitX,fruitY,snakeLength=2,ft=0,bombX[100],bombY[100],bombAmount=3,bombLoop=1; + int posX[101],posY[101],fruitX,fruitY,snakeLength=2,ft=0,bombX[100],bombY[100],bombAmount=3,bombLoop=1; int tempX[2],tempY[2]; bool bombShown[100]; double thistimeMillisec; @@ -465,7 +465,7 @@ int game(){ init_pair(1,COLOR_WHITE, COLOR_BLACK); wbkgd(stdscr, COLOR_PAIR(1)); printf("\e[?25l");//ปิดcursor - for(int i=0;i<100;i++){ + for(int i=0;i<101;i++){ posX[i]=-1; posY[i]=-1; }