Skip to content

Update main.kt#9

Open
DoomzD wants to merge 3 commits intohyperskill:masterfrom
DoomzD:master
Open

Update main.kt#9
DoomzD wants to merge 3 commits intohyperskill:masterfrom
DoomzD:master

Conversation

@DoomzD
Copy link
Copy Markdown

@DoomzD DoomzD commented Feb 9, 2019

No description provided.

Copy link
Copy Markdown

@SerVB SerVB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прошу поправить моменты. Скорее всего, будет не одна итерация проверки. На всякий случай упомяну, что стоит помечать сделанные комменты как resolved.

Copy link
Copy Markdown

@SerVB SerVB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне нравится! Есть еще несколько моментов.

Copy link
Copy Markdown

@SerVB SerVB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошая работа. Засчитываем. Если хочешь, можешь посмотреть еще пару комментов. Ну и можешь продолжить прогать этот проект, если хочешь) Если что, спрашивай.

fun printField() {
println(" |abcdefghi|\n-|${"-".repeat(FIELD_SIZE - 2)}|")
fun getField(): String {
var fieldString = ""
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Глянь на StringBuilder. В отличие от строки, он мутабелен, поэтому более эффективен (ну этот SB вообще прикол Java и ,NET мира). При конкатенации строки создается новый объект и это не очень.

CellState.MARKED -> visibleField[rowId][colId] = CellState.EMPTY
CellState.EMPTY -> visibleField[rowId][colId] = CellState.MARKED
CellState.OPENED -> return "Cell is opened"
CellState.NUMBERED -> return "Cell is opened"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Одинаковые ветки можно не дублировать, написав через запятую условия.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants