-
-
Save jasongorman/7cc1c6c8ec807745711e3e2f7bd65342 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 ({startsFacing, endsFacing}) { | |
it(`turns right from ${startsFacing} to ${endsFacing}`, () => { | |
let rover = {facing: startsFacing}; | |
rover = go(rover, "R"); | |
assert.equal(rover.facing, endsFacing); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment