diff --git a/src/app/lib/Character.ts b/src/app/lib/Character.ts index 012860f1..c15eeb8e 100644 --- a/src/app/lib/Character.ts +++ b/src/app/lib/Character.ts @@ -11,14 +11,12 @@ export class Character { direction: CharacterDirection; color: CellColor; penDown: boolean; - path: string[]; constructor({ color = 'red', direction = 'down', id = uuidv4(), name = 'Bear', - path = ['1,1'], penDown = true, x = 1, y = 1, @@ -39,7 +37,6 @@ export class Character { this.direction = direction; this.color = color; this.penDown = penDown; - this.path = path; } moveForward(): void { @@ -63,10 +60,6 @@ export class Character { break; } } - - if (this.penDown) { - this.path.push(`${this.x},${this.y}`); - } } moveBack(): void { @@ -90,10 +83,6 @@ export class Character { break; } } - - if (this.penDown) { - this.path.push(`${this.x},${this.y}`); - } } turnLeft(): void { diff --git a/src/app/lib/solveProblem.ts b/src/app/lib/solveProblem.ts index 1c97c969..875cf46a 100644 --- a/src/app/lib/solveProblem.ts +++ b/src/app/lib/solveProblem.ts @@ -87,8 +87,7 @@ export function isAnswerCorrect( answerCharacter.y === correctCharacter.y && answerCharacter.direction === correctCharacter.direction && answerCharacter.color === correctCharacter.color && - answerCharacter.penDown === correctCharacter.penDown && - answerCharacter.path?.join(',') === correctCharacter.path?.join(',') + answerCharacter.penDown === correctCharacter.penDown ); return character; });