Giter Club home page Giter Club logo

mine-eluder-app's Introduction

Mine-Eluder-App

A simple game app using TextViews, EditTexts, Buttons and Intents. This app is an upgradation to the command-line game "Mine-Eluder" which I developed using C++.

Intro about the Game

Mine Eluder is a 2-D grid based game with some cells having obstacles. Initially all the cells are covered. The goal of the game is to uncover all the possible cells that do not have obstacles. The player can step into any location inside the grid and uncover it. The obstacles are called as mines, where the player should not step into, if he steps into the mine and uncovers it, then the game ends there. There are three difficulty levels in this game, Newbie, Specialist and Master. The dimension of grid and probability of mines is determined according to the difficulty level.

Rules of the Game

  1. The rule of the game is to uncover all the cells that do not have mines in it.

  2. To uncover any cell you may enter the cell location. If the cell you entered has mine it in, then you lose the game, else the game continues.

  3. You can choose the difficulty of the game. There are three difficulty options available. They are

    • NEWBIE
    • SPECIALIST
    • MASTER

Configuration of the Grid

1. Dimension of the Grid

NEWBIE 5*5 (Total 25 cells)
SPECIALIST 7*7 (Total 49 cells)
MASTER 9*9 (Total 81 cells)

2. Probability of Mines

NEWBIE 0.20 (Total 5 mines in 25 cells)
SPECIALIST 0.30 (Total 15 mines in 49 cells)
MASTER 0.40 (Total 33 mines in 81 cells)

Scoring

Your score is calculated as: (c * 100) / (d - ceil(d * p))

  • Here,
    • c - cells unlocked which doesn't have mines
    • d - total cells
    • p - probability of mines

Approach Used

The grid is implemented as a Sparse Matrix where mines are the non-zero elements and other cells are the zero elements. This Sparse Matrix is represented in memory using 2-D ArrayList based on coordinate list method where row and column of mines location is stored. This thereby saves ^((1 - 2 * p) * 100)% of memory. The locations of non-zero elements in the Sparse Matrix is filled using the random function present in the Kotlin Random Class.

^ (p - probability of mines) -> the result is approximate value

Screenshots of the App

Note: I developed this game using C++ which is a command-line application and this app is an upgradation to it with a good UI. You can find the C++ code here ๐Ÿ‘‰ Click Here

mine-eluder-app's People

Contributors

kiruba-r11 avatar

Stargazers

 avatar  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.