Commit 64727dd5 authored by Stefanie Hasler's avatar Stefanie Hasler

tcr

parent ab6b5e4f
......@@ -13,6 +13,9 @@ class MarsRover {
if (this.dir === 'E') {
this.x++
}
else if (this.dir === 'S') {
this.y--
}
else {
this.y++
}
......@@ -65,4 +68,8 @@ describe("MarsRover", () => {
it('should turn right, move forward, and have moved east', () => {
expect(new MarsRover().right().forward().pos()).to.equal('1,0,E')
})
it('should turn right twice, move forward, and have moved south', () => {
expect(new MarsRover().right().right().forward().pos()).to.equal('0,-1,S')
})
})
\ 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