Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #2

Open
wants to merge 1 commit into
base: JavaLand4Kids-2023
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Keys controls are only for debugging purpose:

## 👨‍🏫 Workshop
If you want to do the workshop check out the branch `Javaland4Kids`. In this state the game logic is missing and needs
to be implemented. Therefore, the tests are separated into 8 easy steps (`step1` - `step8`). Each step contains several
to be implemented. Therefore, the tests are separated into 8 easy steps (`step1` - `step5`). Each step contains several
tests. Code until a step is running green:
```bash
./gradlew jvmTest
Expand Down
4 changes: 2 additions & 2 deletions src/commonMain/kotlin/j4k/candycrush/model/Row.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Row(rowSize: Int) : Iterable<Tile> {

private var tiles = Array(rowSize) { Tile.Hole }

operator fun get(row: Int): Tile {
operator fun get(column: Int): Tile {
// TODO: Step 2.2 Handle OutOfSpace for tiles
return tiles[row]
return tiles[column]
}

fun isInRow(column: Int): Boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/j4k/candycrush/model/Tile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum class Tile {
val index = ordinal

/**
* @return `true` if [Tile] is ([Tile.A] - [Tile.A]).
* @return `true` if [Tile] is ([Tile.A] - [Tile.E]).
* Otherwise `false` ([Tile.Hole], [Tile.OutOfSpace], [Tile.Wall]).
*/
fun isTile(): Boolean {
Expand Down