diff --git a/TECHDEBT.md b/TECHDEBT.md index b5ad355..00be4c9 100644 --- a/TECHDEBT.md +++ b/TECHDEBT.md @@ -1,11 +1,4 @@ # TODO -- [ ] Readability - - [x] comments - - [x] dead code - - [x] magic strings/numbers - - [x] bad naming - - [x] antipattern - - [ ] scopes # RPP - [ ] Complexity @@ -27,3 +20,10 @@ # DONE - [x] Make ktlint pass checks +- [x] Readability + - [x] comments + - [x] dead code + - [x] magic strings/numbers + - [x] bad naming + - [x] antipattern + - [x] scopes diff --git a/src/main/kotlin/org/example/Rover.kt b/src/main/kotlin/org/example/Rover.kt index 16aea31..9ccdc37 100644 --- a/src/main/kotlin/org/example/Rover.kt +++ b/src/main/kotlin/org/example/Rover.kt @@ -49,12 +49,6 @@ class Rover { private var state = RoverState() } -class RoverState { - var positionX: Int = 0 - var positionY: Int = 0 - var heading: Char = HEADING_NORTH -} - private const val ROVER_MINIMUM_NEEDED_COMMANDS = 3 private const val ROVER_STARTING_POSITION_X = 0 private const val ROVER_STARTING_POSITION_Y = 1 @@ -65,7 +59,7 @@ private const val COMMAND_TURN_LEFT = 'L' private const val COMMAND_TURN_RIGHT = 'R' private const val COMMAND_MOVE = 'M' -private const val HEADING_EAST = 'E' -private const val HEADING_NORTH = 'N' -private const val HEADING_WEST = 'W' -private const val HEADING_SOUTH = 'S' +internal const val HEADING_EAST = 'E' +internal const val HEADING_NORTH = 'N' +internal const val HEADING_WEST = 'W' +internal const val HEADING_SOUTH = 'S' diff --git a/src/main/kotlin/org/example/RoverState.kt b/src/main/kotlin/org/example/RoverState.kt new file mode 100644 index 0000000..5b83b93 --- /dev/null +++ b/src/main/kotlin/org/example/RoverState.kt @@ -0,0 +1,7 @@ +package org.example + +class RoverState { + var positionX: Int = 0 + var positionY: Int = 0 + var heading: Char = HEADING_NORTH +} \ No newline at end of file