Giter Site home page Giter Site logo

avr_mines's Introduction

AVR Mines

Introduction

AVR Mines is a Minesweeper implementation for AVR. Minesweeper

Minesweeper is a game in which the player is given a board with a certain number of spaces that contain hidden mines. To win, the player must select all empty spaces, avoiding the mines.

Gameplay

The board is a 5 x 14 matrix which starts with all spaces hidden, as seen in Figure 1. Once a space is selected, it and its neighbors are revealed. A space can be empty or contain a mine. Empty spaces display the total value of adjacent mines, or nothing if they have no neighbouring mines.

Figure 1. Board with all spaces hidden

A space reveals no neighbours if it has any adjacent mines. There are 14 mines on the board, and if any one of them are selected, the game is lost. The player can mark houses where they believe there are mines with flags to make the game easier, as seen in Figure 2. When all empty houses are selected, the player wins the game. Then, the player can restart the game with a new, randomly generated board.

Figure 2. Partially explored board

End of game

  • Success: every empty space was revealed;

  • Defeat: a mine was selected.

Every space is revealed and the appropriate message is shown, as seen in Figures 2 and 3. The player then may press the FLAG button to restart the game.

Figure 3. Victory screen

Figura 4. Defeat screen

Resources used

To implement this game, the AVR atmega328 processor and the pcd544 display were used. The project was simulated with simulIDE 0.4.15_SR9-1. Six buttons were used, four for movement and two others. Of the latter, the CHECK button is responsible for starting the game and for selecting a field, while FLAG is used for restarting the game and marking a square on the board with a flag.

Building and running

The game may be built and ran by executing $ make in the project's root directory and then loading the generated .hex file within simulIDE after using it to open simulide/mines.simu (right click the CPU and select "Load firmware").

avr_mines's People

Contributors

bernardozomer avatar gaspary23 avatar

Watchers

 avatar  avatar

Forkers

joinin-73

avr_mines's Issues

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.