Code Monkey home page Code Monkey logo

two-player-minesweeper's Introduction

two-player-minesweeper


Project made in collaboration with Alper Kılınç


This VHDL code demonstrates a 2 player version of minesweeper (video game) on a SPARTAN 3A/3AN FPGA board. There are two modes. 1st for placing mines 2nd for playing the game. At first mode a 3-bit input is taken from the user to put a mine to 1 of 8 displays. At second mode if player fails to guess where the mine is "lose" is displayed on the display. If user guesses a spot correctly lights of the area is shut down. When there is one spot left, also the same area with the mine, "success" is shown on the display.

ONLY POWER SWITCH MUST BE ON BEFORE STARTING THE GAME

PLAYER 1 RULES

  1. MODE PIN SHOULD BE DOWN! (P78)
  2. YOU SHOULD FIRST SELECT A 3-BIT BINARY NUMBER WITH P5 P12 P15. P15 BEING THE LEAST SIGNIFICANT AND P5 BEING THE MOST. PLACEMENT RULES ARE AS FOLLOWS:
  • IF 001 IS SELECTED 2ND RIGHTMOST DISPLAY IS SELECTED (INPUT’S VALUE IN BASE 10) + 1 = COLUMNS PLACE FROM RIGHT TO LEFT
  1. WITHOUT TURNING DOWN THE SELECTED PINS USER MUST TRIGGER HIT BUTTON (P82) --YOUR CHOICE IS SAVED!— *IF YOU DECIDE TO CHANGE THE PLACE OF YOUR MINE, YOU CAN TURN DOWN HIT BUTTON RE-SELECT YOUR 3-BIT INBUT AND TRIGGER AGAIN. 4.TURN DOWN THE TRIGGER BUTTON THEN SET ALL COLUMN PINS (P5 P12 P15) TO ZERO. ORDER IS IMPORTANT. --YOUR MINE IS PLACED!—

PLAYER 2 RULES

1.TO PLAY YOU SHOULD ACTIVATE MODE PIN (SET TO 1) (P78) IMPORTANT NOTE! : SINCE A MINE TRIGGERS WHEN YOU TOUCH IT, YOU ARE NOT ALLOWED TO UNSELECT AN AREA. AFTER SELECTING AN AREAYOU ARE ONLY ALLOWED TO USE THE TRIGGER BUTTON! SELECTING AN AREA: FROM P85 TO P15 EVERY PIN STANDS FOR A MINE HOLDER PLACE. SAME ORDER GOES FOR SEVEN SEGMENT DISPLAY AND PINS. 2. AFTER AN AREA IS SELECTED USER MUST HIT TRIGGER (P82) 3. IF THERE IS A MINE IN THE SELECTED AREA GAME WILL DISPLAY “LOSE”. AFTER A GAME ENDS USER MUST TURN THE GAME OFF AND RESTART AGAIN. 4.IF THERE IS NO MINE IN THE AREA. AREA’S LIGHT WILL SHUT DOWN. USER MUST TURN DOWN DEFUSED COLUMN AREA AND THE TRIGGER BUTTON BEFORE MOVING ONTO A NEW AREA. (LEAVING TRIGGER BUTTON STILL WORKS BUT FOR PLAYER EXPERIENCE IT SHOULD BE TURNED OFF) ENDGAME 2 AREAS AND 1 MINE LEFT: IF USER SELECTS THE MINE AREA. HE/SHE LOSES. AFTER CLEARING THE LAST AREA USER MUST TURN DOWN THE SELECTED AREA PIN. HIT BUTTON CAN BE ON/OFF. “SUCCESS” IS DISPLAYED.

two-player-minesweeper's People

Contributors

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