An implementation of Minesweeper game using Javascript and React.js

Affiliation: University of Thessaly
Resolution: Individual
Duration: One to two hours, Two to four hours



Minesweeper is a single-player puzzle video game. The objective of the game is to clear a rectangular board containing hidden "mines" or bombs without detonating any of them, with help from clues about the number of neighboring mines in each field. By building this game you use the React Js. By solving the problem you will become familiar with the use of React Js, you will get new ones knowledge of it and programming. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.

Learning Objectives

Minesweeper is a one-person game which looks deceptively easy to play, but where average human performance is far from optimal. Playing the game requires logical, arithmetic and probabilistic reasoning based on spatial relationships on the board. Simply checking a board state for consistency is an NP-complete problem. Given the difficulty of hand-crafting strategies to play this and other games, AI researchers have always been interested in automatically learning such strategies from experience. Through this exercise, we show that when integrating certain techniques into a general purpose learning system (Mio), the resulting system is capable of inducing a Minesweeper playing strategy that beats the winning rate of average human players. In addition, students may discuss the necessary background knowledge, present experimental results demonstrating the gain obtained with our techniques and show the strategy learned for the game. React allows developers to create large web applications that can change data, without reloading the page. The main purpose of React is to be fast, scalable, and simple


A player left-clicks a cell to uncover it. If a player uncovers a mined cell, the game ends. Otherwise, the uncovered cells displays either a number, indicating the quantity of mines adjacent to it, or a blank tile (or "0"), and all adjacent non-mined cells will automatically be uncovered. Right-clicking on a cell will flag it, causing a flag to appear on it. Flagged cells are still covered, and a player can click on them to uncover them, although typically they must first be unflagged with an additional right-click. The first click in any game will never be a mine. To win the game, players must uncover all non-mine cells, at which point the timer is stopped. Flagging all the mined cells is not required.