CoursesCSS StudioExamplesGATECompaniesPrepMentora
Programs/JavaScript/Mini Projects

13 / 20

Next
1. Todo List2. Calculator3. Stopwatch4. Countdown Timer5. Quiz App6. Weather App7. Image Carousel8. Modal/Lightbox9. Tabs/Accordion10. Autocomplete Search11. Shopping Cart12. Tic-Tac-Toe13. Snake Game14. Memory Game15. Drag and Drop List16. Form Builder17. Chat Application18. Data Table with Sort/Filter19. Progress Bar20. Infinite Scroll

Mini Projects

  1. 01Todo List
  2. 02Calculator
  3. 03Stopwatch
  4. 04Countdown Timer
  5. 05Quiz App
  6. 06Weather App
  7. 07Image Carousel
  8. 08Modal/Lightbox
  9. 09Tabs/Accordion
  10. 10Autocomplete Search
  11. 11Shopping Cart
  12. 12Tic-Tac-Toe
  13. 13Snake Game
  14. 14Memory Game
  15. 15Drag and Drop List
  16. 16Form Builder
  17. 17Chat Application
  18. 18Data Table with Sort/Filter
  19. 19Progress Bar
  20. 20Infinite Scroll

Snake Game in JavaScript

Create a snake game

AdvancedMini ProjectsExample 13 of 20
snake-game.js
1class Snake {
2 constructor() { this.body = [{x: 10, y: 10}]; this.direction = 'right'; }
3 move() { /* Move snake */ }
4 grow() { /* Grow snake */ }
5 checkCollision() { /* Check collisions */ return false; }
6}

Output

// Snake game

What's going on

Snake Game implements classic snake gameplay.

PreviousTic-Tac-ToeNextMemory Game

On this page

CodeOutputExplanation
Up nextMemory Game
Schoolabe

Learn, Practice, Ace Coding

ExamplesCompaniesTutorialsCSS StudioDSA VisualizersQuizInterview PrepMentoraCareer QuestGATE CS prepGATE CS 2027 study planJob ReadyInternships
AboutContactCareersAffiliate programBlog
DocumentationAPI ReferenceCommunitySupport
Privacy PolicyTermsRefund PolicyCookie Policy

© 2026 Schoolabe