-
-
Save jasongorman/33097689de7fbd950e8f2b3a802d92e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{startsFacing: "N", endsFacing: "E"}, | |
{startsFacing: "E", endsFacing: "S"}, | |
{startsFacing: "S", endsFacing: "W"}, | |
{startsFacing: "W", endsFacing: "N"} | |
].forEach( | |
function (testCase) { | |
it("turns right", () => { | |
let rover = {facing: testCase.startsFacing}; | |
rover = go(rover, "R"); | |
assert.equal(rover.facing, testCase.endsFacing); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment