diff --git a/codenamesServer/codenamesServerCardService/task.md b/codenamesServer/codenamesServerCardService/task.md index 4caa5874..b76ebedf 100644 --- a/codenamesServer/codenamesServerCardService/task.md +++ b/codenamesServer/codenamesServerCardService/task.md @@ -1,7 +1,7 @@ Wow! You've almost finished the project! This is the last step. The package `jetbrains.kotlin.course.codenames.card` already has the regular class `CardService`. In this task, you need to implement the `generateWordsCards` function with the following behavior: -- If `words.size < TOTAL_NUMBER`, you need to throw an error. `words` is an already defined variable with `List`, which contains all possible words for the game. You've already declared `TOTAL_NUMBER` in the `Utils` object in the `jetbrains.kotlin.course.codenames.utils` package. +- If `words.size < TOTAL_NUMBER`, you need to throw an error. `words` is a variable of type `List` and is already defined in the `Words.kt` file of the `jetbrains.kotlin.course.codenames.utils` package. It contains all possible words for the game. You've already declared `TOTAL_NUMBER` in the `Utils` object in the `jetbrains.kotlin.course.codenames.utils` package. - Next, you need to _shuffle_ `words` and create `TOTAL_NUMBER` cards by _taking_ them from the shuffled word list and creating new instances of the `Card` class (use `CardState.Front` as a state). - Don't forget to _drop_ all words from the `words` list that were used for the generated cards. diff --git a/wordsGeneratorServer/wordsGeneratorServerWord/task.md b/wordsGeneratorServer/wordsGeneratorServerWord/task.md index 1f7da838..33b4aaf1 100644 --- a/wordsGeneratorServer/wordsGeneratorServerWord/task.md +++ b/wordsGeneratorServer/wordsGeneratorServerWord/task.md @@ -1,10 +1,10 @@ -The **goal** of this step is to implement the `Word` and `WordServices` classes. +The **goal** of this step is to implement the `Word` and `WordService` classes. First of all, create a value class `Word` with one `String` property `word` to store a word in the `jetbrains.kotlin.course.words.generator.word` package in the `WordModel.kt` file. -Next, find the already added `WordServices` class in the `jetbrains.kotlin.course.words.generator.word` package and modify it: -- Add a companion object to the `WordServices` class and declare the `numberOfWords` variable to store the number - of words in the game. Initialize this variable as the _size_ of the predefined list of words `words`. +Next, find the already added `WordService` class in the `jetbrains.kotlin.course.words.generator.word` package and modify it: +- Add a companion object to the `WordService` class and declare the `numberOfWords` variable to store the number + of words in the game. Initialize this variable as the _size_ of the predefined list of words `words` (which is defined in the `Words.kt` file of the `jetbrains.kotlin.course.words.generator.util` package). - Implement the `generateNextWord` function: if the `words` list _is empty_, throw an error; else, get the first element from the `words` list and remove it from the list, then create a new `Word` and return it.