Skip to content

Commit 4360659

Browse files
author
Daniel Barclay
committed
ColoredLines: Refining Board: Renamed BoardPlus items to ...boardPlus.
1 parent f387bbc commit 4360659

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/main/scala/com/us/dsb/explore/algs/coloredlines/manual/game/GameLogicSupport.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ object GameLogicSupport {
3030
}
3131
}
3232

33+
//???? probably split into BoardState-level vs. level of BoardState + score
34+
case class MoveResult(boardPlus: BoardPlus,
35+
//??? clarify re placing next three balls (re interpreting differently in different contexts
36+
anyRemovals: Boolean)
37+
{
38+
println(s"??? ${this}")
39+
//??? print("")
40+
}
41+
3342
/**
3443
* @param board
3544
* expected to be empty //???? maybe refactor something?
@@ -132,15 +141,6 @@ object GameLogicSupport {
132141
postPlacementResult.copy(boardPlus = postPlacementResult.boardPlus.withOnDeckBalls(List.fill(3)(pickRandomBallKind())))
133142
}
134143

135-
//???? rename? isn't _user_ move result; is ball move/placement/arrival result
136-
case class MoveResult(boardPlus: BoardPlus,
137-
//??? clarify re placing next three balls (re interpreting differently in different contexts
138-
anyRemovals: Boolean)
139-
{
140-
println(s"??? ${this}")
141-
//??? print("")
142-
}
143-
144144
private[game] def doPass(boardPlus: BoardPlus)(implicit rng: Random): MoveResult =
145145
placeNextBalls(boardPlus)
146146

src/main/scala/com/us/dsb/explore/algs/coloredlines/manual/game/lines/LineDetector.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ import com.us.dsb.explore.algs.coloredlines.manual.game.board.{BallKind, BoardPl
88
//???? TODO: reduce repeated passing of board, etc.; maybe make LineDetector a
99
// class, to be instantiated for each move; or make local class for passing (but
1010
// leave external-client interface same
11-
object LineDetector {
11+
object LineDetector { //????? adjust most from using BoardPlus to using just BoardState
1212

1313
private[lines] case class LineAxis(labelArray: String,
1414
rowDelta: Int, // -1 / 0 / 1 (Make refined type?)
1515
colDelta: Int)
1616

1717
private[this] val lineAxes =
1818
List(
19-
LineAxis("", 0, +1), // → W --> E
19+
LineAxis("", 0, +1), // → W --> E
2020
LineAxis("", +1, +1), // ↘ NW --> SE
21-
LineAxis("", +1, 0), // ↓ N --> S
21+
LineAxis("", +1, 0), // ↓ N --> S
2222
LineAxis("", +1, -1)) // ↙ NW --> SW
23+
2324
private[this] val relativeDirectionFactors = List(1, -1) // use type of length 2 (refined List?, Tuple2?, some array?)
2425

2526
private[lines] def haveMatchingBallAt(moveBallColor: BallKind,

0 commit comments

Comments
 (0)