Skip to content

2nd Console App - #1

Open
Andreydev1 wants to merge 2 commits into
mybranchfrom
dev
Open

Andreydev1 wants to merge 2 commits into
mybranchfrom
dev

Conversation

@Andreydev1

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/main/kotlin/Main.kt
println("Привет")
val archives: MutableList<Archive> = mutableListOf()
var screenManager: ScreenManager = ScreenManager()
val screen: Screen = MainScreen("Список Архивов", archives, screenManager)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

При инициализации локальной переменной можно не прописывать ее тип

override fun openScreen() {
super.openScreen()
println("0.Создать архив")
var ArchiveIndex: Int = 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Переменные по код стайлу нужно называть в camelCase

println("0.Создать архив")
var ArchiveIndex: Int = 0
for (i in archiveList) {
println("${++ArchiveIndex}.${i.ArchiveName}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше тогда forEachIndexed, чтобы не создавать лишнюю переменную ArchiveIndex

println("0.Создать заметку")
var noteIndex: Int = 0
for (i in archive.notes) {
println("${++noteIndex} ${i.noteName}")

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