Code Monkey home page Code Monkey logo

snake's Introduction

Snake

Want to play snake? Go ahead! ---> Take me to it. Try to beat my highscore of 97!

--- 15-02-2018 D-M-Y ---

Recently, I looked at the code I had written, and thought: I could do better now. So I have.

I still want to make a bot for snake, although I've lost interest in the other goals.

--- 17-01-2017 D-M-Y ---

This project started two years ago when I made a snake game while learning JavaScript.

Recently I looked at the code I had written, and cringed. So I made a fresh version of the game 'snake' with my current knowledge.

The fresh version is called 'snake.html', which references 'snake.js'. The old version is called 'SnakeGameOld.html', which references 'SnakeGameOld.js'. The code has not been touched for two years, and will never be updated.

The end goal is to develop an algorithm that will beat the snake game everytime. (With A*)

The restrictions to the algorithm are similar to a humans, in the sense that the information given to it is limited. Only including:

‣ A one dimensional array of objects representing the segments of the snake,
	in order from tail to head, each containing an 'x' and 'y' property.
‣ An object representing the location of the apple,
	containing two integer properties 'x' and 'y'.

In addition, it is only allowed to affect the game by simulating user-input.

Checklist

Things I plan to add to the code:

‣ A settings panel for the user, possible variables they could change:

	‣ Game speed.
	‣ Number of columns.
	‣ Number of rows.
	‣ Colors.

‣ Use an icon for the apple.
‣ Draw only what is needed to the canvas.
‣ A 'playerBot' which is described above.
‣ Make an implementation in Java.

This entire document is subject to change at any time. (Especially if I make typos.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.