(answer: string)
| 13 | |
| 14 | // Public methods |
| 15 | public isRight(answer: string): boolean{ |
| 16 | // If the answer is the current number of candies we possess |
| 17 | if(Algo.simplifyString(answer) == this.game.getCandies().getCurrent().toString() || |
| 18 | Algo.simplifyString(answer) == (this.game.getCandies().getCurrent()+1).toString() || |
| 19 | Algo.simplifyString(answer) == (this.game.getCandies().getCurrent()+2).toString() || |
| 20 | Algo.simplifyString(answer) == (this.game.getCandies().getCurrent()+3).toString() || |
| 21 | Algo.simplifyString(answer) == (this.game.getCandies().getCurrent()-1).toString() || |
| 22 | Algo.simplifyString(answer) == (this.game.getCandies().getCurrent()-2).toString() || |
| 23 | Algo.simplifyString(answer) == (this.game.getCandies().getCurrent()-3).toString() |
| 24 | ) |
| 25 | return true; |
| 26 | |
| 27 | // The answer isn't correct |
| 28 | return false; |
| 29 | } |
| 30 | } |
nothing calls this directly
no test coverage detected