RDM 13 - Easy

Register
Submit a solution
Status: ‌Cancelled client request

Challenge Overview

Easy

In this Easy problem, let's create a simple first iteration version of our Snake game.

Requirements:

  • Host your page at / on port 8080
  • A div called "boardContainer"- within it a board of size 20x20.
  • Within the div, one line for each row of the board
  • Within a line, a character "_" for an open position
  • Within a line, a character "*" for a snake position
  • Listen to keypresses "w", "a", "s", "d" on the keyboard, according to the WASD convention:
    w - up
    a - left
    s - down
    d - right
  • The player starts at index 10,'10 - aka in the middle of the board
  • When pressing a movement button, the snake "moves" in that direction
  • When the snake moves, a "*" character is added to the new position of the snake. All previously remaining snake points stay unaffected
  • If the snake moves to a position that already has a "*" character , the game ends
  • If the snake moves to a position outside the board
  • When the game ends, display "GAME OVER" within the "boardContainer"

The game should reset when refreshing the page.

CHANGELOG: added note to make it clear that going outside board ends the game too

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30365810