R: Readability (scopes)
This commit is contained in:
parent
9a56cc4f79
commit
bedefaba94
3 changed files with 18 additions and 17 deletions
14
TECHDEBT.md
14
TECHDEBT.md
|
|
@ -1,11 +1,4 @@
|
||||||
# TODO
|
# TODO
|
||||||
- [ ] Readability
|
|
||||||
- [x] comments
|
|
||||||
- [x] dead code
|
|
||||||
- [x] magic strings/numbers
|
|
||||||
- [x] bad naming
|
|
||||||
- [x] antipattern
|
|
||||||
- [ ] scopes
|
|
||||||
|
|
||||||
# RPP
|
# RPP
|
||||||
- [ ] Complexity
|
- [ ] Complexity
|
||||||
|
|
@ -27,3 +20,10 @@
|
||||||
|
|
||||||
# DONE
|
# DONE
|
||||||
- [x] Make ktlint pass checks
|
- [x] Make ktlint pass checks
|
||||||
|
- [x] Readability
|
||||||
|
- [x] comments
|
||||||
|
- [x] dead code
|
||||||
|
- [x] magic strings/numbers
|
||||||
|
- [x] bad naming
|
||||||
|
- [x] antipattern
|
||||||
|
- [x] scopes
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,6 @@ class Rover {
|
||||||
private var state = RoverState()
|
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_MINIMUM_NEEDED_COMMANDS = 3
|
||||||
private const val ROVER_STARTING_POSITION_X = 0
|
private const val ROVER_STARTING_POSITION_X = 0
|
||||||
private const val ROVER_STARTING_POSITION_Y = 1
|
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_TURN_RIGHT = 'R'
|
||||||
private const val COMMAND_MOVE = 'M'
|
private const val COMMAND_MOVE = 'M'
|
||||||
|
|
||||||
private const val HEADING_EAST = 'E'
|
internal const val HEADING_EAST = 'E'
|
||||||
private const val HEADING_NORTH = 'N'
|
internal const val HEADING_NORTH = 'N'
|
||||||
private const val HEADING_WEST = 'W'
|
internal const val HEADING_WEST = 'W'
|
||||||
private const val HEADING_SOUTH = 'S'
|
internal const val HEADING_SOUTH = 'S'
|
||||||
|
|
|
||||||
7
src/main/kotlin/org/example/RoverState.kt
Normal file
7
src/main/kotlin/org/example/RoverState.kt
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.example
|
||||||
|
|
||||||
|
class RoverState {
|
||||||
|
var positionX: Int = 0
|
||||||
|
var positionY: Int = 0
|
||||||
|
var heading: Char = HEADING_NORTH
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue