socialtables / connect-four Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
We would like to know if a game state is valid. A valid game state means that given a 2D array representing game pieces, those pieces could have actually been created by two players following the rules of the game (alternating turns dropping pieces).
Functional Requirements:
For this issue, a board should be considered valid if:
Example of a valid game board:
[[null, null, null, null, null, 1 ],
[null, null, null, null, 1, 2 ],
[null, null, null, null, null, 2 ],
[null, null, null, null, 1, 2 ],
[null, null, null, 2, 1, 1 ],
[null, null, null, null, null, null ],
[null, null, null, null, 1, 2 ]]
Examples of invalid game board:
[[null,null,null,null,null,1],
[null,null,null,null,null,2],
[null,null,null,2,1,1],
[null,null,2,2,1,2],
[null,null,null,null,null,2],
[null,null,null,null,null,null],
[null,null,null,null,null,null]]
The feature consists of a button called "Help me win". When this button is clicked, one of two things should happen:
User Interface:
Computer AI:
We need to add a database to store each game and its current state so that it can be loaded again.
In addition, we want to be able to keep track of every turn that has happened. There needs to be a "Turn History" (list) in the user interface that describes what happened during that turn. Clicking on a previous Turn in the History List will ask the user if they want revert back to that turn's board state.
The actual database provider can be anything you like (SQL-based, NoSQL).
This exercise is intentionally open-ended to allow the code contributor freedom to implement a sensible solution. That being said, if you have any clarifying questions, you can contact [email protected]
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.