Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions map.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ void map_boundary(int Map_Size) /* Print the boundar
boundary.x = Map_Size;
boundary.y = Map_Size;
for(i = 0; i < Map_Size; i ++)
goprint(Map_Size, i, "�");
goprint(Map_Size, i, "�");
for(i = 0; i < Map_Size; i ++)
goprint(i, Map_Size, "�");
goprint(Map_Size, Map_Size, "�");
goprint(i, Map_Size, "�");
goprint(Map_Size, Map_Size, "�");
}

void map_0(int Map_Size) /* Print the outer blocks */
Expand Down
12 changes: 6 additions & 6 deletions snake.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void snake_create(void) /* Make the snake at
snake_tail->y = snake_head->y + 2;
snake_tail->next = NULL;
for(p = snake_head; p != NULL; p = p->next)
goprint(p->x, p->y, "��");
goprint(p->x, p->y, "io");
}

void snake_control(void)
Expand All @@ -36,7 +36,7 @@ void snake_control(void)
if(control == 'p' || control == 'P')
break;
if(control == 'w' || control == 's' || control == 'a' || control == 'd' || control == 'W' || control == 'S' || control == 'A' || control == 'D'){
if((direction == 'w' || direction == 'w') && (control == 's' || control == 'S')) ;
if((direction == 'w' || direction == 'W') && (control == 's' || control == 'S')) ;
else if((direction == 's' || direction == 'S') && (control == 'w' || control == 'W')) ;
else if((direction == 'a' || direction == 'A') && (control == 'd' || control == 'D')) ;
else if((direction == 'd' || direction == 'D') && (control == 'a' || control == 'A')) ;
Expand All @@ -45,7 +45,7 @@ void snake_control(void)
}
snake_move();
}
goprint(snake_head->x, snake_head->y, "��");
goprint(snake_head->x, snake_head->y, "iA");
}

void snake_move(void)
Expand Down Expand Up @@ -117,7 +117,7 @@ void snake_move(void)
*temp = front;
temp->next = snake_head;
snake_head = temp;
goprint(snake_head->x, snake_head->y, "��");
goprint(snake_head->x, snake_head->y, "io");
if(front.x == award_food.x){
score += award_score / 2 * level;
award_food.x = -1, award_food.y = -1, award_score = 100;
Expand All @@ -137,7 +137,7 @@ void snake_move(void)
snake_tail->next = NULL;
snake_head->x = front.x;
snake_head->y = front.y;
goprint(snake_head->x, snake_head->y, "��");
goprint(snake_head->x, snake_head->y, "io");
}

void snake_free(void)
Expand All @@ -147,4 +147,4 @@ void snake_free(void)
p1 = p1->next;
free(p2);
}
}
}