Giter Site home page Giter Site logo

minesweeper's Introduction

Minesweeper

Finally, the Minesweeper game I've had locked in a cellar for several months

Pharap Logo Licencing

Please note that the 'Pharap Logo' is copyrighted by Pharap and thus not licenced for general use.
If you plan to create a derivitive game I suggest replacing the logo with your own.

Code Licencing

The source code is licenced under the Apache 2.0 licence.
This means that you are free to copy and edit the code, but you must:

  • Retain all copyright notices
  • Document your changes

Graphics Licencing

All graphics (excepting the aforementioned logo) are released under the Creative Commons Attribution-NonCommercial-ShareAlike licence ('CC BY-NC-SA').

CC BY-NC-SA

You can find a copy of the licence in Graphics/BY-NC-SA.txt.

minesweeper's People

Contributors

eried avatar jrincayc avatar pharap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

eried jrincayc

minesweeper's Issues

Improve Marsaglia citation

The code currently cites Marsaglia:

// This is actually part of the algorithm for an 'Xorshift' PRNG variant.
// PRNG algorithms that have a single-value state can be easily repurposed as hash functions.
// The shift values are taken from page 4 of George Marsaglia's 'Xorshift RNGs'.
// Marsaglia's 'Xorshift RNGs': https://www.jstatsoft.org/article/view/v008i14

But it doesn't currently mention the paper's licence (CC BY 3.0),
or that the code was written from scratch using values tabulated in the paper.

Using reinterpret_cast in a constexpr expression is non-standard

Using reinterpret_cast in a constexpr expression is non-standard, so this needs to be changed:

static constexpr SaveBlock * SaveAddress = reinterpret_cast<SaveBlock *>(SaveStart);
static constexpr Header * HeaderAddress = reinterpret_cast<Header *>(HeaderStart);
static constexpr DataType * DataAddress = reinterpret_cast<DataType *>(DataStart);
static constexpr uint32_t * ChecksumAddress = reinterpret_cast<uint32_t *>(ChecksumStart);
static constexpr uint16_t * DataSizeAddress = reinterpret_cast<uint16_t *>(DataSizeStart);

Make the EEPROM save system future-proof

At the moment adding new information to the 'save file' will cause it to become incompatible with existing saves.

The save system needs to be future-proofed so that new setting can be added without invalidating save states from older versions.

Note that this is a breaking change and hence part of the reason for a major version increment.

Reorganise Stats screen

Currently the stats screen displays as:

Wins: 1
Losses: 1

I think it would be better to rearrange it to this:

Wins:
1

Losses:
1

because then the locations of the numbers won't depend on the language being used.

Fix stack overflow

There's a fatal stackoverflow bug in the EEPROM verification code.
It needs to be fixed before the code can develop any further.

Specifically the problem stems from here:

char buffer[dataSize];

When EERPOM is uninitialised, the size value read from eerpom could easily exceed the entire size of RAM, let alone the size of the stack.
There are several ways this problem can be solved.
Figuring out the best way is incredibly difficult.

Add a credits entry for "Graphics"

As part of the big v2.0.0 update, some new graphics created by @vampirics are going to be added to the game.

In response to this, a new category in the credits list for "Graphics" needs to be introduced.

Consider restructuring to use src file

There's an issue with Arduino projects in which only .cpp files in either the root of the project or a src folder will compile.

At the time this game was written I was unaware of it,
hence a lot of stuff got dumped in the root.
But now that I am aware, it might be a good idea to someday fix the issue.

Configurable size of board and number of mines

It would be more replayable if we could choose a bigger board (fill in some of the space that currently just has background with more mine spaces) and if we could choose more or less mines.

Remove the old 'themes' easter egg

In the old v1.0.0-v1.1.0 versions there was an easter egg on the title screen that implemented 'theme' selection.
As of the big v2.0.0 update, this is being promoted from an easter egg to a full feature.

Now that a proper "Themes" option has been added, the old easter egg functionality needs to be removed because it's redundant.

Note that this is a breaking change and hence part of the reason for a major version increment.

Improve theme selection UI

Currently the theme selection state is still using placeholder graphics.
These need to be replaced with some better graphics.

Reduce size of Minesweeper logo

Currently the minesweeper logo has a lot of excess blank space.
This space should be trimmed down to make the logo smaller in preparation for adding a new menu option.

Stack allocated arrays are non-standard

Stack allocated arrays such as the following are non-standard:

char buffer[dataSize];

char buffer[dataSize];

The required array buffers should instead be passed as reference parameters.


The Arduboy's screen buffer would serve a suitable replacement buffer as it's 1KB (as large as the whole of EEPROM) and unused at the point in time that checksum verification needs to be done.

Fix the casing of file names in include statements

Certain includes are only working because of case insensitivity.
The cases need to be fixed to be case sensitive so they work on case sensitive file systems.

Reference here

Had trouble compiling on Linux because of case-sensitivity - different filenames vs. includes for TitleScreenState / TitlescreenState and SplashScreenState / SplashscreenState.

Add save functionality for themes

Currently the theme resets to theme 0 every time the console is reset.
Instead, the chosen theme should persist in EEPROM even after the device is turned off.

Depends on #22 being implemented.

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.