I am going to write a program in which there is a while loop in which the user can input the program at any time, but the while loop does not wait to receive the user input and continues to work. Whenever a user enters a new input, the program will run according to that input. The program is in C ++ and the name of the program is Snake Game. I'm sorry because my code is too long, I can show a small part of it.
while(1)
{
Move(grid,snake,grid_rows,grid_cols,len_snake,ch);
show(grid,grid_rows,grid_cols);
Sleep(1000);
cin>>ch;
system("CLS");
}