Skip to content

Commit

Permalink
add - Added directional snake head
Browse files Browse the repository at this point in the history
---

We've added a directional snake head to more easily indicate what direction is the snake facing.

---

Type: add
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jan 27, 2024
1 parent e0e8c30 commit 53d854b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ public static void InitializeSnaker(bool Simulation)
int PositionX = Convert.ToInt32(PositionStrings[0]);
int PositionY = Convert.ToInt32(PositionStrings[1]);
ConsoleWrapper.SetCursorPosition(PositionX, PositionY);
ConsoleWrapper.Write(" ");
string snakeHead = PositionIndex < SnakeMassPositions.Count - 1 ? " " :
Direction == SnakeDirection.Top ? "^" :
Direction == SnakeDirection.Bottom ? "v" :
Direction == SnakeDirection.Left ? "<" :
Direction == SnakeDirection.Right ? ">" :
" ";
ConsoleWrapper.Write(snakeHead);
ConsoleWrapper.SetCursorPosition(PositionX, PositionY);
DebugWriter.WriteDebug(DebugLevel.I, "Drawn snake at ({0}, {1}) for mass {2}/{3}", PositionX, PositionY, PositionIndex + 1, SnakeMassPositions.Count);
}
Expand Down

0 comments on commit 53d854b

Please sign in to comment.