Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created September 26, 2020 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/965c1457b94a8cbd51d1efac477ec5c5 to your computer and use it in GitHub Desktop.
Save jasongorman/965c1457b94a8cbd51d1efac477ec5c5 to your computer and use it in GitHub Desktop.
[{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