Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 3.43 KB

README.mkdn

File metadata and controls

67 lines (46 loc) · 3.43 KB

Setup

First you should checkout the project from GitHub. (We presume Git is already installed.) Please note these instructions presume a Unix-like environment for your host operating system; however, this should all work in Windows as well. (Documentation tweaks are welcomed!)

$ git clone [email protected]:jjn1056/TicTacToe.git 
$ cd TicTacToe

The easiest way to run this application is from Vagrant, using Virtualbox, a free virtual-machine system. You can find and install these tools from the following links:

  • Vagrant - Manage local or remote virtual machines
  • Virtualbox - Open source virtual machine for many host operating systems

After installing the chosen tools you should use Vagrant to bring up the virtual machine. The first time it starts, Vagrant sets up and provisions the virtual machine. During this process, it will download the base "box," which might take a bit of time depending on the speed of your Internet connection. After the virtual machine is running, you should SSH into it:

$ vagrant up
$ vagrant ssh

At this point you are in the virtual machine. You should then cd to the /vagrant directory and from there you should be able to see your local checkout of the application:

$ cd /vagrant

The provisioning process will have set up a local::lib and a local installation of Perl 5.20.1, so you can just go ahead and start the server:

CATALYST_DEBUG=1 DBIC_TRACE=1 make server

The server is listening on port 5000 of the virtual machine (guest). This port is also mapped to the host, so you can now open a web browser to http://localhost:5000/, and you should be able to see running application.

Projects

Complete as many of the following as you wish.

Report Page

We need a new endpoint that provides the following information

  • Total number of completed games
  • Total number of running games (games not yet in a complete state)
  • Total X wins
  • Total O wins
  • Total draws
  • Total number of moves in all games
  • Average number of moves in a game across all games

Report page should contain a timestamp. Testcase should be provided

Pagination for the list of all games

Currently the root endpoint returns a full list of all running and completed games. This list could get very long. Add pagination controls to the HTML and JSON for this. For bonus points add sorting by status (X win, O win, Draw, In Progress). For Double bonus points add a RSS or ATOM feed for the full games list.

Document and test you new code.

Game History

Right now you can only see the current or end state of a game board. Change the system so that when a game is completed, you get a way to see the game board state at a given move for that game. For example the game screen could have a list of all the boards (in move order) with links to display the state of that board for that move.

TicTacToe::Controller::Root, line 38

Complete the noted TODO in the referenced line. The issue here is that should the Form be invalid, there is no HTML template to report that issue. Make this correct, with a test case to demonstrate. Be sure you don't break the JSON view!

TicTacToe::Controller::Game, line 27

Complete the noted TODO in the referenced line. This is also a missing support for the HTML View (no template). Create the template and give a use case. Be sure you don't break the JSON view!