Skip to content

Commit

Permalink
GREEN: assessment example string
Browse files Browse the repository at this point in the history
  • Loading branch information
alirmemon37 committed Aug 30, 2023
1 parent e621422 commit 511a0c4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/chandrayaan.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,21 @@ describe("Chandrayaan 3 should", () => {
chandrayaan([0, 0, 0], "U", "S")
);
});

/*
NOTE: the answer does not require the final facing direction
it only requires the final position and direction
we maintain the facing direction for correctly determining the final position
*/
it("when executing multiple commands", () => {
const { position, direction } = execute(
"frubl",
chandrayaan([0, 0, 0], "N", "U")
);

expect({ position, direction }).toEqual({
position: [0, 1, -1],
direction: "N",
});
});
});

0 comments on commit 511a0c4

Please sign in to comment.