Problem
I played games on Linux Ubuntu 16.04 and 18.04. At level 1, if all the food is eaten, a segmentation fault occurs without going to level 2 and the program terminates.
Goal
The goal is to make the game progress to level 2 when all food is eaten at level 1.
Steps to solve the problem
Study how to use the gdb debugger.
Set breakpoints where you think the cause of the error and look at them line by line.
Problem I played games on Linux Ubuntu 16.04 and 18.04. At level 1, if all the food is eaten, a segmentation fault occurs without going to level 2 and the program terminates.
Goal The goal is to make the game progress to level 2 when all food is eaten at level 1.
Steps to solve the problem