qosaassets.blogg.se

Best windows terminal games
Best windows terminal games











best windows terminal games

So instead of passing pointers to these, just pass the values.

best windows terminal games

But you don't actually change the value of *direction or *snake. You currently pass in pointers such as *direction and *snake to your functions. I'll show several areas where the code could be improved. I'm going to focus this review on one specific part of your code, which is there part where you move the snake. Void DestroySnake(struct SnakeNode **snake) Nnode = (struct SnakeNode *)malloc(sizeof(struct SnakeNode)) Lnode = GetListItem(*snake,GetSnakeSize(*snake)-1) Graphics(*snake,*food,*score,*highscore) Void Physics(struct SnakeNode **snake,int *direction,struct Food *food,int *score,int *highscore,int *endgame) If(snake->x = iterator->x & snake->y = iterator->y) Int GetSnakeSize(struct SnakeNode *snake) Struct SnakeNode * GetListItem(struct SnakeNode *snake,int index) Void CreateFood(struct Food *food,struct SnakeNode *snake) Void Graphics(struct SnakeNode *snake,struct Food food,int score,int highscore) *snake = (struct SnakeNode *)malloc(sizeof(struct SnakeNode)) Void CreateSnake(struct SnakeNode **snake) SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c) Physics(&snake,&direction,&food,&score,&highscore,&endgame) Void DestroySnake(struct SnakeNode **snake) Ĭhar map =

best windows terminal games

Int isSnake(int x,int y,struct SnakeNode *snake) I would apreciate any suggestions on how to make my code better and more efficient.













Best windows terminal games