The application is a simulation of a turtle moving around a pond, of dimension 5 units x 5 units. There are no other obstructions in the pond. The turtle is free to roam around the surface of the pond, but will be prevented from touching the walls surrounding the pond (anything outside of the 5 x 5 grid). Any movement that would result in the turtle leaving the pond would be prevented, however further valid movement commands would still be allowed.
This application is coded in React JS framework, depending on the inputs in text box, mouse click and arrow keys the turtle will move inside the pond accordingly (Custom version of turtle pond game).
- React js with redux - JavaScript library for building user interfaces and to store the state of the application.
- Webpack - Module Bundler.
- Babel - JavaScript compiler.
- Eslint - Linter tool to maintain the code quality.
- Mocha/Chai, Sinon - Testing framework
To see the results quickly, I have already compiled the javascript files using webpack and added to this package.
So, this project can run without installing in the local machine. Just open the index.html file in the browser (present in the following location ..\public\index.html)
If you want to install and run the project in the local machine, follow the below steps.
- Install node server v5.4.1
- Open the terminal and go to root folder of this project
- Run
npm install
(This command will download all the dependencies of this project)
- Open the terminal and go to root folder of this project
- Run
npm run start
- Open browser and hit http://localhost:3000
- Open the terminal and go to root folder of this project
- Run
npm run test
- Open the terminal and go to root folder of this project
- Run
npm run test-cover
Note: if test-cover is not working, then Run npm install babel-cli -g
and re-run test-cover
- Type command in the format 'PLACE 1,2,NORTH' which places the turtle in the appropriate X and Y axis in the grid and in the direction specified
- Type LEFT (or use 'left' arrow) which rotates the turtle in left direction and RIGHT (or use 'right' arrow) which rotates it in right direction
- Type MOVE (or use 'up' arrow) which moves the turtle by 1 unit in the direction it is facing. It cannot move beyond the grid.
- Type REPORT (or use 'down' arrow) which reports the location of the turle in the grid to the console.
- Click on the grid to place the turtle in that location(direction by default is north or it faces the direction it is already in)
- Appropriate error messages on user commands
- Improve code coverage
- Convert CSS to SASS