Commit ef8d8d45 authored by Stefanie Hasler's avatar Stefanie Hasler

tcr

parent 64727dd5
......@@ -16,6 +16,9 @@ class MarsRover {
else if (this.dir === 'S') {
this.y--
}
else if (this.dir === 'W') {
this.x--
}
else {
this.y++
}
......@@ -72,4 +75,8 @@ describe("MarsRover", () => {
it('should turn right twice, move forward, and have moved south', () => {
expect(new MarsRover().right().right().forward().pos()).to.equal('0,-1,S')
})
it('should move west', () => {
expect(new MarsRover().right().right().right().forward().pos()).to.equal('-1,0,W')
})
})
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment