jjjxu / minesweepercollab Goto Github PK
View Code? Open in Web Editor NEWMinesweeper Collaboration for AP CS Final Project 2019
Minesweeper Collaboration for AP CS Final Project 2019
Attributes needed -
Operations needed
first clear: when the user first hits a square, we need to make sure that the generated pattern doesn't result in a death on the first one: this square also cannot be immediately adjacent to anything else (i.e. should be a space square w/o any number displayed)
mark as mine/unmark as mine: self-explanatory
dig up: only allow if the thing isn't marked as a mine. can also be invoked via the auto dig method, but should return a value of whether the thing got blown up or not.
auto dig: extra, quick clear operation
standard getter/setter? maybe omit because that's extra work and isn't really needed in the final version, only for debug.
This class should control all local aspects of the game
Local vars (off the top of my head)
probably size
array of squares which is the actual gameboard
constructor: takes the size of the game? for resizing GUIs, we can just make every new game a new window
start game: takes the coordinates of the first click. First click needs to be on a square that's by definition a 0. This step will also generate the grid. Generation is achieved by defining a fraction of the board (probably around 1/4-1/5) of the game board which are mines. Then, by generating numbers in that range, we can drop mines into the board by sequentially tracing through, skipping numbers in the region that are already marked to be mines or are in the no-bomb zone that is defined by the 3x3 square surrounding the click (error check for edges, etc). This will be a boolean array. Next, we calculate and initiate the real game board. Then, we purge the original boolean, so info hiding has been achieved.
operate on a square: passes thru a click with parameters of the given operand, and then calls this method.
display: returns a array of int values, for the GUI to parse. This will be called by the GUI after every move.
floodfill: when an empty square is hit, we need to keep on going and open up the board.
Not finished, Ethan's code will be modified slightly and JDoc'ed correctly to compliance.
Consider the image-based thing on swing for a gui (would need to probably immediately associate an image within the structure of the square class) versus the processing version where there would be a parallel data structure that does all the drawing, bordering, etc for you.
Also need terminal I/O thingy first instead of GUI so linking up is easier
how tf do we also enable/disable the buttons so we're not getting random stuff entered
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.