Below is the coding challenge. You have 2 hours to complete the challenge. If you need more time to finish, please send us what you have at the 2 hour mark and then send over your final solution once you have completed it (within 24 hours). We will assess you on both versions.
You can use any programming language you are comfortable with. When ready, please email your code as an attachment (please do not put the solution on GitHub or any other public repository).
Thank you!
Your task is to write an implementation of the game Connect-4 (http://en.wikipedia.org/wiki/Connect_Four).
In Connect-4, there are two players, and each of the players take turns trying to get four of their game pieces in a row.
Write a functional subset of the code for the game board, game pieces, and player state. Your code should include functions to place a piece into the game board and check if one of the players has won the game. Your code should simulate the turns taken by players (in other words, you do NOT have to collect actual input from players, so you should not build UI to do so).
Your code should also include a function to print out the board, in ASCII. For example, here is a plausible print out after two turns - one from player 'x' and player 'o':
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* X O * * * *
Your code should also include a function to print out the board, in ASCII. For example, here is a plausible print out after two turns - one from player 'x' and player 'o':
The code must be functional and given to us in a state where we can easily run it.
npm run start