Skip to content

Week1 snake game task completed#7

Open
mozammalrahat wants to merge 2 commits intorecruit-org:mainfrom
mozammalrahat:snake_week1
Open

Week1 snake game task completed#7
mozammalrahat wants to merge 2 commits intorecruit-org:mainfrom
mozammalrahat:snake_week1

Conversation

@mozammalrahat
Copy link
Copy Markdown

No description provided.

pages/index.js Outdated

case "ArrowRight":
setDirection(Direction.Right);
setDirection((prevDirection)=>{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by creating a helper function that takes in the directions and calculates the next direction, you can remove the redundancy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants