Coder Social home page Coder Social logo

py-snake-escape's Introduction

Snake Escape / Iguana escape optimisation

The original game and source code was shared with me and the original author is unknown. This repository improves the original code and starts tracking the history for future use.

Gameplay

You play the role of an iguana that needs to move towards a goal while avoiding snakes that hunt you. The game is played by modifying the generate_iguana_move to create a algorithm that decides what the best move for the iguana based only on the game state.

The engine will run your algorithm with random test cases and will return a final win score.

Note that the iguana moves first (then the snakes)
Return either "up", "down", "left", or "right"

To win, the iguana ('I') must reach the goal ('G')
The iguana will always spawn at the centre of the grid
Snakes ('S') will randomly spawn on the boundaries of the grid, as will the goal.
Snakes will always move in the direction of the iguana.
If a snake touches the iguana you lose ('X'). If the iguana touches the goal you win ('W').

Sample score

Wins: 153 Losses: 9847 Win Ratio: 0.015537727226566466 Win Percent: 1.53

py-snake-escape's People

Contributors

mk5med avatar

Watchers

 avatar

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.