Skip to content

sajjanjyothi/monstergame

Repository files navigation

README
======

solution
=========

Monster game created as per given instructions (Used CPP as primary language for solution)
This solution can be improved using STL maps.Used vector for simplicity.

Unit test
=========
All unit tests are captures using cppunit test framework(http://cppunit.sourceforge.net/doc/cvs/index.html)

Compilation
===========
Project can be compiled as make clean; make (This will create both solution binary and test binary)
Created maven project POM(Object model), I haven't tested this using maven

Used STL container Vector for map and monster storage
Algorithm find_if used for searching within container

Execution
===========
./main <number of monsters>

Not Implemented
==============
I haven't implemented city removal correctly within processMonster (City routes also need to be removed)
Not tested with maven

Sample Unit test run
====================
sajjanjyothi$ ./unit_test 
TestMonster::testgetNumber : OK
TestMonster::testgetCity : OK
TestCity::testGetMonster1 : OK
TestCity::testGetMonster2 : OK
TestCity::testGetName : OK
TestCity::testGetEast : OK
TestCity::testGetWest : OK
TestCity::testGetSouth : OK
TestCity::testGetNorth : OK
OK (9)


Sample Run outputs
==================
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ ./main 1 | wc -l
    6763
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ cat map.txt | wc -l
    6763
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ ./main 10 | wc -l
    6763
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ ./main 100 | wc -l
    6724
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ ./main 500 | wc -l
    6516
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ ./main 1000 | wc -l
    6287
sajjans-MacBook-Air:MIMECAST sajjanjyothi$ 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published