Skip to content

amozalev/react-snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React snake game

Image alt

Implementation notes:

  1. Doubly linked list stores snake coordinates.
    1. Pros: doubly linked list easily implements "sliding window" pattern (pop last element and push new one) and takes O(1) time.
    2. Cons: Searching of crossing a snake with itself or with game borders runs with order O(n).
  2. Circular array loop is implemented in the "easy" game mode.

About

React snake game using doubly linked list to store snake coordinates

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published