Skip to content

Stage-2 data class#2

Open
Serpak13 wants to merge 3 commits intomasterfrom
stage1
Open

Stage-2 data class#2
Serpak13 wants to merge 3 commits intomasterfrom
stage1

Conversation

@Serpak13
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@ievetrov ievetrov left a comment

Choose a reason for hiding this comment

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

Хорошо, едем дальше. Но ветки скорее всего надо в порядок привести

@Serpak13
Copy link
Copy Markdown
Owner Author

@ievetrov будет сделано)

Copy link
Copy Markdown

@ievetrov ievetrov left a comment

Choose a reason for hiding this comment

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

Оставил несколько комментариев. Пока из основного, это что нужно упорядочить код

val word = Word(original = line[0], translate = line[1])
dictionary.add(word)
}
var correctAnswersCount = 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.

это не просто переменная, а поле класса Word. такая же часть сущности, как и оригинал и перевод

}
var correctAnswersCount = 0 //Счётчик для выученных слов

/* val dictionary2 = dictionary.filter {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

какая функция этого комментария?

}*/
val dictionary2 = dictionary
for (i in dictionary2){
println("Как переводится слово: ${i.original}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

этого задания нет в описании этапа

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

и мы используем только 1 словарь. это то, что получено из файла




do{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

тут достаточно классического цикла while true



val quantityWords = dictionary.size //Количество слов в словаре
val percentageRatio = (correctAnswersCount.toFloat() / quantityWords.toFloat()) * 100
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

33 и 34 лучше перенести туда , где они используются. там же добывать правильные слова. нужен порядок в коде. чтобы ничего лишнего не было за пределами when/цикла, если это не переиспользуется еще где-то

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