- Doubly linked list stores snake coordinates.
- Pros: doubly linked list easily implements "sliding window" pattern (pop last element and push new one) and takes O(1) time.
- Cons: Searching of crossing a snake with itself or with game borders runs with order O(n).
- Circular array loop is implemented in the "easy" game mode.
-
Notifications
You must be signed in to change notification settings - Fork 0
amozalev/react-snake-game
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
React snake game using doubly linked list to store snake coordinates
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published