Created
July 11, 2016 09:20
-
-
Save simpleprogrammer-shared/b7b1a295cd9bc7216e2ea0f886198a0c to your computer and use it in GitHub Desktop.
Types of Duplication in Code 1
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
public Position WalkNorth() | |
{ | |
var player = GetPlayer(); | |
player.Move("N"); | |
return player.NewPosition; | |
} | |
public Position WalkSouth() | |
{ | |
var player = GetPlayer(); | |
player.Move("S"); | |
return player.NewPosition; | |
} | |
public Position WalkEast() | |
{ | |
var player = GetPlayer(); | |
player.Move("E"); | |
return player.NewPosition; | |
} | |
public Position WalkWest() | |
{ | |
var player = GetPlayer(); | |
player.Move("W"); | |
return player.NewPosition; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment