├── .courseignore ├── .github └── workflows │ ├── gradle-build.yml │ └── gradle-test.yml ├── .gitignore ├── .idea └── inspectionProfiles │ ├── Custom_Inspections.xml │ └── profiles_settings.xml ├── AlmostDone ├── CompleteTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── Introduction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── MultiRowStrings │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── NullSafety │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── NullSafetyPartTwo │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── StringFunctions │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── StringFunctionsPartTwo │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── When │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── applyBordersFilterFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── choosePictureFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── errorFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── lesson-info.yaml ├── lesson-remote-info.yaml ├── letScopeFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── linesFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── multiRowStringsTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── nullSafetyTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── nullValue │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── repeatFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── safeReadLineFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PhotoshopTestsUtils.kt │ │ └── Tests.kt ├── stringBuilder │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── almost │ │ │ └── done │ │ │ ├── Images.kt │ │ │ ├── Main.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md └── whenTheory │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── almost │ │ └── done │ │ ├── Images.kt │ │ ├── Main.kt │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── Chat ├── askFirstQuestion │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── chat │ │ │ └── Main.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── askSecondQuestion │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── chat │ │ │ └── Main.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── chatIntro │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── chat │ │ │ └── Main.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── completeTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── chat │ │ │ └── Main.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── lesson-info.yaml └── lesson-remote-info.yaml ├── FeedbackSurvey ├── Survey │ ├── src │ │ └── Main.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── lesson-info.yaml └── lesson-remote-info.yaml ├── Hangman ├── CompleteTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── Core │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── CreateTheGame │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── generateSecretFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── getHiddenSecretFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── getRoundResultsFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── isCompleteFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── isCorrectInputFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── hangman │ │ │ ├── Main.kt │ │ │ ├── Util.kt │ │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── Core.kt │ │ ├── HangmanTestUtil.kt │ │ └── Tests.kt ├── lesson-info.yaml ├── lesson-remote-info.yaml └── safeUserInputFunction │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── hangman │ │ ├── Main.kt │ │ ├── Util.kt │ │ └── Words.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ ├── Core.kt │ ├── HangmanTestUtil.kt │ └── Tests.kt ├── Introduction ├── lesson-info.yaml ├── lesson-remote-info.yaml └── welcome │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── welcome │ │ └── Main.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── LICENSE.md ├── LastPush ├── CanvasGapsGenerator │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── CanvasGenerator.kt │ │ ├── CanvasWithGapsGenerator.kt │ │ ├── DropTopLine.kt │ │ ├── Helpers.kt │ │ ├── MainClass.kt │ │ ├── PatternsGeneratorTestsUtils.kt │ │ └── Tests.kt ├── CanvasGenerator │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── CanvasGenerator.kt │ │ ├── CanvasWithGapsGenerator.kt │ │ ├── DropTopLine.kt │ │ ├── Helpers.kt │ │ ├── MainClass.kt │ │ ├── PatternsGeneratorTestsUtils.kt │ │ └── Tests.kt ├── CompleteTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── CanvasGenerator.kt │ │ ├── CanvasWithGapsGenerator.kt │ │ ├── DropTopLine.kt │ │ ├── Helpers.kt │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ ├── PatternsGeneratorTestsUtils.kt │ │ └── Tests.kt ├── Helpers │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── CanvasGenerator.kt │ │ ├── CanvasWithGapsGenerator.kt │ │ ├── Helpers.kt │ │ ├── MainClass.kt │ │ ├── PatternsGeneratorTestsUtils.kt │ │ └── Tests.kt ├── PatternsGenerator │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── dropTopLineFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── CanvasGenerator.kt │ │ ├── CanvasWithGapsGenerator.kt │ │ ├── DropTopLine.kt │ │ ├── Helpers.kt │ │ ├── MainClass.kt │ │ ├── PatternsGeneratorTestsUtils.kt │ │ └── Tests.kt ├── getPatternHeightFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── last │ │ │ └── push │ │ │ ├── Main.kt │ │ │ ├── Patterns.kt │ │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── CanvasGenerator.kt │ │ ├── CanvasWithGapsGenerator.kt │ │ ├── Helpers.kt │ │ ├── MainClass.kt │ │ ├── PatternsGeneratorTestsUtils.kt │ │ └── Tests.kt ├── lesson-info.yaml ├── lesson-remote-info.yaml └── repeatHorizontallyFunction │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── last │ │ └── push │ │ ├── Main.kt │ │ ├── Patterns.kt │ │ └── PreDefinedSymbols.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ ├── CanvasGenerator.kt │ ├── CanvasWithGapsGenerator.kt │ ├── Helpers.kt │ ├── MainClass.kt │ ├── PatternsGeneratorTestsUtils.kt │ └── Tests.kt ├── MastermindAdvanced ├── CompleteTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── MastermindTestUtil.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── errorHandling │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── generateSecretFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── MastermindTestUtil.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── introduction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── isCorrectInputFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── MastermindTestUtil.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── joinToStringFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── lesson-info.yaml ├── lesson-remote-info.yaml ├── randomFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── mastermind │ │ │ └── advanced │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md └── safeUserInputFunction │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── mastermind │ │ └── advanced │ │ ├── Main.kt │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ ├── MainClass.kt │ ├── MastermindTestUtil.kt │ ├── Methods.kt │ └── Tests.kt ├── README.md ├── TheFirstDateWithProgramming ├── BuiltinFunctions │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── CompleteTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── Introduction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── ProgramEntryPoint │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── ReadUserInput │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── Variables │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ └── Tests.kt ├── builtinFunctionsTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── comments │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── lesson-info.yaml ├── lesson-remote-info.yaml ├── programEntryPointTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── readUserInputTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── first │ │ │ └── date │ │ │ ├── Main.kt │ │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md └── variablesTheory │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── first │ │ └── date │ │ ├── Main.kt │ │ └── RealQuestions.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── WarmUp ├── Collections │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── CollectionsPartTwo │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── CompleteTheProject │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── MastermindTestUtil.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── CustomFunctions │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── If │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── Introduction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── Loops │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── TypesOfVariables │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── breakExpression │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── compositeIf │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── compositeOperators │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── countPartialMatches │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── customFunctionsTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── customFunctionsTheoryPartTwo │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── ifDefinition │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── ifExpression │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── isCompleteFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── isLostFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── isWinFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── lambdaFunctions │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── lesson-info.yaml ├── lesson-remote-info.yaml ├── listTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── loopsTheory │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── mutableVariable │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── playGameMain │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── printRoundResults │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ ├── task.md │ └── test │ │ ├── MainClass.kt │ │ ├── Methods.kt │ │ └── Tests.kt ├── todoFunction │ ├── src │ │ └── main │ │ │ └── kotlin │ │ │ └── jetbrains │ │ │ └── kotlin │ │ │ └── course │ │ │ └── warmup │ │ │ ├── Main.kt │ │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md └── typesOfVariablesTheory │ ├── src │ └── main │ │ └── kotlin │ │ └── jetbrains │ │ └── kotlin │ │ └── course │ │ └── warmup │ │ ├── Main.kt │ │ └── Util.kt │ ├── task-info.yaml │ ├── task-remote-info.yaml │ └── task.md ├── build.gradle.kts ├── contributing.md ├── course-info.yaml ├── course-remote-info.yaml ├── courseIcon.svg ├── gifs ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── jetbrains │ └── kotlin │ └── course │ └── gifs │ ├── almost │ └── done │ │ ├── configs │ │ ├── ChooseFilter.yaml │ │ ├── ChoosePicture.yaml │ │ ├── GetPicture.yaml │ │ ├── Photoshop.yaml │ │ └── TrimmedPicture.yaml │ │ └── runners │ │ ├── ChooseFilter.kt │ │ ├── ChoosePicture.kt │ │ ├── GetPicture.kt │ │ ├── Photoshop.kt │ │ └── TrimmedPicture.kt │ ├── chat │ ├── configs │ │ └── Game.yaml │ └── runners │ │ └── Game.kt │ ├── first │ └── date │ │ ├── configs │ │ ├── Game.yaml │ │ └── UserInput.yaml │ │ └── runners │ │ ├── Game.kt │ │ └── UserInput.kt │ ├── hangman │ ├── configs │ │ └── Game.yaml │ └── runners │ │ └── Game.kt │ ├── last │ └── push │ │ ├── configs │ │ └── App.yaml │ │ └── runners │ │ └── App.kt │ └── warmup │ ├── configs │ ├── Game.yaml │ └── SafeUserInput.yaml │ └── runners │ ├── Game.kt │ └── SafeUserInput.kt ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── utils ├── build.gradle.kts └── src └── main ├── kotlin └── util │ ├── Util.kt │ └── Variable.kt └── resources └── images └── part1 ├── almost.done ├── choose_filter.gif ├── choose_filter_dark.gif ├── choose_picture.gif ├── choose_picture_dark.gif ├── examples │ ├── borders │ │ ├── android.png │ │ ├── android_dark.png │ │ ├── monkey.png │ │ └── monkey_dark.png │ └── squared │ │ ├── android.png │ │ ├── android_dark.png │ │ ├── monkey.png │ │ └── monkey_dark.png ├── game.gif ├── game.png ├── game_dark.gif ├── get_picture.gif ├── get_picture_dark.gif ├── trimmed_picture.gif ├── trimmed_picture_dark.gif ├── when_hint_1.png ├── when_hint_1_dark.png ├── when_hint_2.png └── when_hint_2_dark.png ├── chat ├── game.gif ├── game.png └── game_dark.gif ├── first.date ├── entry_point.png ├── entry_point_dark.png ├── game.gif ├── game.png ├── game_dark.gif ├── run_example.gif ├── run_example_dark.gif ├── user_input.gif └── user_input_dark.gif ├── hangman ├── game.gif ├── game.png └── game_dark.gif ├── last.push ├── app.gif ├── app_dark.gif └── game.png └── warmup ├── game.gif ├── game.png ├── game_dark.gif ├── safe_user_input.gif └── safe_user_input_dark.gif /.courseignore: -------------------------------------------------------------------------------- 1 | README.md 2 | gifs 3 | .gitignore 4 | -------------------------------------------------------------------------------- /.github/workflows/gradle-build.yml: -------------------------------------------------------------------------------- 1 | name: Gradle Build 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-20.04 8 | 9 | steps: 10 | - uses: actions/checkout@v3.0.0 11 | - name: Set up JDK 11 12 | uses: actions/setup-java@v3.0.0 13 | with: 14 | java-version: 11 15 | distribution: liberica 16 | - name: Gradle Wrapper Validation 17 | uses: gradle/wrapper-validation-action@v1.0.4 18 | - uses: gradle/gradle-build-action@v2.1.5 19 | with: 20 | arguments: build --stacktrace -x test 21 | -------------------------------------------------------------------------------- /.github/workflows/gradle-test.yml: -------------------------------------------------------------------------------- 1 | name: Gradle Test 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-20.04 8 | 9 | steps: 10 | - uses: actions/checkout@v3.0.0 11 | - name: Set up JDK 11 12 | uses: actions/setup-java@v3.0.0 13 | with: 14 | java-version: 11 15 | distribution: liberica 16 | - name: Gradle Wrapper Validation 17 | uses: gradle/wrapper-validation-action@v1.0.4 18 | - uses: gradle/gradle-build-action@v2.1.5 19 | with: 20 | arguments: test 21 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /AlmostDone/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/CompleteTheProject/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - Finish The Application 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 9 | visible: true 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 11 | visible: false 12 | - name: test/PhotoshopTestsUtils.kt 13 | visible: false 14 | - name: test/Methods.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/Finish+the+game 19 | -------------------------------------------------------------------------------- /AlmostDone/CompleteTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 819355706 2 | -------------------------------------------------------------------------------- /AlmostDone/CompleteTheProject/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | chooseFilterMethod, 11 | choosePictureMethod, 12 | getPictureMethod, 13 | photoshop, 14 | safeReadLineMethod, 15 | ), 16 | ) 17 | -------------------------------------------------------------------------------- /AlmostDone/Introduction/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun main() { 4 | // Uncomment this code on the last step of the game 5 | 6 | // photoshop() 7 | } 8 | -------------------------------------------------------------------------------- /AlmostDone/Introduction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/Introduction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/Introduction 11 | -------------------------------------------------------------------------------- /AlmostDone/Introduction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1229192821 2 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun main() { 6 | // Uncomment this code on the last step of the game 7 | 8 | // photoshop() 9 | } 10 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - trimPicture Function 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 9 | visible: false 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/MainClass.kt 15 | visible: false 16 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/Multi-row+strings 17 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 669870424 2 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/task.md: -------------------------------------------------------------------------------- 1 | It's time to practice! 2 | 3 | ### Task 4 | 5 | Implement the `trimPicture` function, which accepts a picture and removes all indents from it. 6 | 7 |
8 | 9 | The signature of the function is: 10 | ```kotlin 11 | fun trimPicture(picture: String): String 12 | ``` 13 |
14 | 15 | Here's an example of the `trimPicture` function's work: 16 | 17 | `trimPicture` function work 18 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf(trimPictureMethod) 6 | ) 7 | -------------------------------------------------------------------------------- /AlmostDone/MultiRowStrings/test/Methods.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val trimPictureMethod = TestMethod( 6 | "trimPicture", TestKotlinType("String"), listOf( 7 | TestVariable("picture", "String"), 8 | ) 9 | ) 10 | -------------------------------------------------------------------------------- /AlmostDone/NullSafety/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/NullSafety/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - chooseFilter Function 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 9 | visible: true 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 11 | visible: false 12 | - name: test/PhotoshopTestsUtils.kt 13 | visible: false 14 | - name: test/Methods.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/Null+safety 19 | -------------------------------------------------------------------------------- /AlmostDone/NullSafety/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 553691845 2 | -------------------------------------------------------------------------------- /AlmostDone/NullSafety/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | chooseFilterMethod, 11 | safeReadLineMethod, 12 | ) 13 | ) 14 | -------------------------------------------------------------------------------- /AlmostDone/NullSafetyPartTwo/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/NullSafetyPartTwo/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - getPicture Function 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 9 | visible: true 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 11 | visible: false 12 | - name: test/PhotoshopTestsUtils.kt 13 | visible: false 14 | - name: test/Methods.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/Null+safety+part+two 19 | -------------------------------------------------------------------------------- /AlmostDone/NullSafetyPartTwo/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1368513525 2 | -------------------------------------------------------------------------------- /AlmostDone/NullSafetyPartTwo/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | chooseFilterMethod, 11 | choosePictureMethod, 12 | getPictureMethod, 13 | safeReadLineMethod, 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctions/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctions/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - applyBordersFilter Implementation 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: test/PhotoshopTestsUtils.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 9 | visible: true 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 11 | visible: false 12 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 13 | visible: false 14 | - name: test/Methods.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/String+functions 19 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctions/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 999114955 2 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctions/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | applyBordersFilterMethod, 7 | applySquaredFilterMethod, 8 | applyFilterMethod, 9 | trimPictureMethod, 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctionsPartTwo/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctionsPartTwo/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - applySquaredFilter Implementation 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 11 | visible: false 12 | - name: test/PhotoshopTestsUtils.kt 13 | visible: false 14 | - name: test/Methods.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/String+functions+part+two 19 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctionsPartTwo/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1835776409 2 | -------------------------------------------------------------------------------- /AlmostDone/StringFunctionsPartTwo/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /AlmostDone/When/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun applyFilter(picture: String, filter: String): String { 10 | val trimmedPicture = trimPicture(picture) 11 | return when(filter) { 12 | "borders" -> applyBordersFilter(trimmedPicture) 13 | "squared" -> applySquaredFilter(trimmedPicture) 14 | else -> error("Unexpected filter") 15 | } 16 | } 17 | 18 | fun main() { 19 | // Uncomment this code on the last step of the game 20 | 21 | // photoshop() 22 | } 23 | -------------------------------------------------------------------------------- /AlmostDone/When/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/When/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - applyFilter Function 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 9 | visible: true 10 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/MainClass.kt 15 | visible: false 16 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Almost+done/When 17 | -------------------------------------------------------------------------------- /AlmostDone/When/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 2042704900 2 | -------------------------------------------------------------------------------- /AlmostDone/When/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /AlmostDone/applyBordersFilterFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun main() { 10 | // Uncomment this code on the last step of the game 11 | 12 | // photoshop() 13 | } 14 | -------------------------------------------------------------------------------- /AlmostDone/applyBordersFilterFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/applyBordersFilterFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - Filter Functions 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | - name: test/MainClass.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /AlmostDone/applyBordersFilterFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1988905602 2 | -------------------------------------------------------------------------------- /AlmostDone/applyBordersFilterFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod 9 | ) 10 | ) 11 | -------------------------------------------------------------------------------- /AlmostDone/applyBordersFilterFunction/test/Methods.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val trimPictureMethod = TestMethod( 6 | "trimPicture", TestKotlinType("String"), listOf( 7 | TestVariable("picture", "String"), 8 | ) 9 | ) 10 | 11 | internal val applyBordersFilterMethod = TestMethod( 12 | "applyBordersFilter", 13 | TestKotlinType("String"), 14 | listOf(TestVariable("picture", "String")), 15 | ) 16 | 17 | internal val applySquaredFilterMethod = TestMethod( 18 | "applySquaredFilter", 19 | TestKotlinType("String"), 20 | listOf(TestVariable("picture", "String")), 21 | ) 22 | -------------------------------------------------------------------------------- /AlmostDone/choosePictureFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/choosePictureFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - choosePicture Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 9 | visible: false 10 | - name: test/MainClass.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/PhotoshopTestsUtils.kt 15 | visible: false 16 | - name: test/Tests.kt 17 | visible: false 18 | -------------------------------------------------------------------------------- /AlmostDone/choosePictureFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 553514186 2 | -------------------------------------------------------------------------------- /AlmostDone/choosePictureFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | chooseFilterMethod, 11 | safeReadLineMethod, 12 | choosePictureMethod, 13 | ) 14 | ) 15 | -------------------------------------------------------------------------------- /AlmostDone/errorFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun main() { 10 | // Uncomment this code on the last step of the game 11 | 12 | // photoshop() 13 | } 14 | -------------------------------------------------------------------------------- /AlmostDone/errorFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/errorFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - error Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/errorFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1629287997 2 | -------------------------------------------------------------------------------- /AlmostDone/errorFunction/task.md: -------------------------------------------------------------------------------- 1 | The `when` expression is useful in handling edge cases. 2 | For example, you can simply terminate the execution of the program 3 | and inform the user about errors. 4 | You can achieve this using the [`error`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/error.html) function: 5 | ```kotlin 6 | fun checkNumber(x: Int): Int { 7 | return when (x) { 8 | 0 -> { x + 5 } 9 | 10 -> { x - 5 } 10 | else -> error("Unexpected number") 11 | } 12 | } 13 | ``` 14 | -------------------------------------------------------------------------------- /AlmostDone/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | custom_name: Almost done 3 | content: 4 | - Introduction 5 | - multiRowStringsTheory 6 | - MultiRowStrings 7 | - applyBordersFilterFunction 8 | - whenTheory 9 | - errorFunction 10 | - When 11 | - linesFunction 12 | - repeatFunction 13 | - stringBuilder 14 | - StringFunctions 15 | - StringFunctionsPartTwo 16 | - nullValue 17 | - nullSafetyTheory 18 | - safeReadLineFunction 19 | - NullSafety 20 | - letScopeFunction 21 | - choosePictureFunction 22 | - NullSafetyPartTwo 23 | - CompleteTheProject 24 | is_template_based: false 25 | -------------------------------------------------------------------------------- /AlmostDone/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 815582437 2 | -------------------------------------------------------------------------------- /AlmostDone/letScopeFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/letScopeFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - let Scope Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/letScopeFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1609671976 2 | -------------------------------------------------------------------------------- /AlmostDone/linesFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun applyFilter(picture: String, filter: String): String { 10 | val trimmedPicture = trimPicture(picture) 11 | return when(filter) { 12 | "borders" -> applyBordersFilter(trimmedPicture) 13 | "squared" -> applySquaredFilter(trimmedPicture) 14 | else -> error("Unexpected filter") 15 | } 16 | } 17 | 18 | fun main() { 19 | // Uncomment this code on the last step of the game 20 | 21 | // photoshop() 22 | } 23 | -------------------------------------------------------------------------------- /AlmostDone/linesFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/linesFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - lines Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/linesFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1298754091 2 | -------------------------------------------------------------------------------- /AlmostDone/linesFunction/task.md: -------------------------------------------------------------------------------- 1 | When working with multiline strings, you can break them into lines and handle each one separately. 2 | This can be done using the [`lines`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/lines.html) function: 3 | ```kotlin 4 | """First line 5 | Second line 6 | """.lines() 7 | ``` 8 | The string will be converted into a list with two strings: `First line` and `Second line`. 9 | 10 | This function is better than `split`, since it considers 11 | newline symbols from various operating systems under the hood: 12 | 13 | ```kotlin 14 | """First line 15 | Second line 16 | """.lines() // works on all OSs 17 | ``` 18 | VS 19 | ```kotlin 20 | """First line 21 | Second line 22 | """.split("\n") // does not work on Windows 23 | ``` 24 | -------------------------------------------------------------------------------- /AlmostDone/multiRowStringsTheory/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun main() { 4 | // Uncomment this code on the last step of the game 5 | 6 | // photoshop() 7 | } 8 | -------------------------------------------------------------------------------- /AlmostDone/multiRowStringsTheory/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/multiRowStringsTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - Multi Row Strings 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/multiRowStringsTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 965912956 2 | -------------------------------------------------------------------------------- /AlmostDone/nullSafetyTheory/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/nullSafetyTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - Null Safety 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/nullSafetyTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 230726355 2 | -------------------------------------------------------------------------------- /AlmostDone/nullValue/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/nullValue/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - null Value 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/nullValue/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 192844197 2 | -------------------------------------------------------------------------------- /AlmostDone/nullValue/task.md: -------------------------------------------------------------------------------- 1 | When defining a type, you can specify that it could also have a special `null` value. 2 | It's a `null` reference, which doesn't refer to anything. 3 | We will delve into more details about this in the following parts of the course; 4 | for now, it is enough to know some basic things. 5 | 6 | To indicate that a type might be `null`, you should add `?` to the type, for example: 7 | ```kotlin 8 | // 'a' can be String or null 9 | var a: String? = null 10 | ``` 11 | 12 | If a value can be `null`, then the various built-in functions that we talked about earlier 13 | cannot automatically work with such a value, for example: 14 | ```kotlin 15 | var a: String? = null 16 | a.length // INCORRECT!! 17 | 18 | var a: String = "text" 19 | a.length // CORRECT 20 | ``` 21 | -------------------------------------------------------------------------------- /AlmostDone/repeatFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun applyFilter(picture: String, filter: String): String { 10 | val trimmedPicture = trimPicture(picture) 11 | return when(filter) { 12 | "borders" -> applyBordersFilter(trimmedPicture) 13 | "squared" -> applySquaredFilter(trimmedPicture) 14 | else -> error("Unexpected filter") 15 | } 16 | } 17 | 18 | fun main() { 19 | // Uncomment this code on the last step of the game 20 | 21 | // photoshop() 22 | } 23 | -------------------------------------------------------------------------------- /AlmostDone/repeatFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/repeatFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - repeat Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/repeatFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1495658846 2 | -------------------------------------------------------------------------------- /AlmostDone/repeatFunction/task.md: -------------------------------------------------------------------------------- 1 | To generate a string by repeating a symbol, you can use the [`repeat`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/repeat.html) function: 2 | ```kotlin 3 | "@".repeat(4) 4 | ``` 5 | It will generate the following string: `@@@@`. 6 | -------------------------------------------------------------------------------- /AlmostDone/safeReadLineFunction/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/safeReadLineFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Console Photoshop - safeReadLine Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 9 | visible: false 10 | - name: test/MainClass.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/PhotoshopTestsUtils.kt 15 | visible: false 16 | - name: test/Tests.kt 17 | visible: false 18 | -------------------------------------------------------------------------------- /AlmostDone/safeReadLineFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 2065245492 2 | -------------------------------------------------------------------------------- /AlmostDone/safeReadLineFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.almost.done", 5 | customMethods = listOf( 6 | trimPictureMethod, 7 | applyBordersFilterMethod, 8 | applySquaredFilterMethod, 9 | applyFilterMethod, 10 | safeReadLineMethod 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /AlmostDone/stringBuilder/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun applyFilter(picture: String, filter: String): String { 10 | val trimmedPicture = trimPicture(picture) 11 | return when(filter) { 12 | "borders" -> applyBordersFilter(trimmedPicture) 13 | "squared" -> applySquaredFilter(trimmedPicture) 14 | else -> error("Unexpected filter") 15 | } 16 | } 17 | 18 | fun main() { 19 | // Uncomment this code on the last step of the game 20 | 21 | // photoshop() 22 | } 23 | -------------------------------------------------------------------------------- /AlmostDone/stringBuilder/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/stringBuilder/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - StringBuilder 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/stringBuilder/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 223687468 2 | -------------------------------------------------------------------------------- /AlmostDone/whenTheory/src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.almost.done 2 | 3 | fun trimPicture(picture: String) = picture.trimIndent() 4 | 5 | fun applyBordersFilter(picture: String): String = TODO("Not implemented yet") 6 | 7 | fun applySquaredFilter(picture: String): String = TODO("Not implemented yet") 8 | 9 | fun main() { 10 | // Uncomment this code on the last step of the game 11 | 12 | // photoshop() 13 | } 14 | -------------------------------------------------------------------------------- /AlmostDone/whenTheory/src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.almost.done 4 | 5 | val borderSymbol = '#' 6 | val separator = ' ' 7 | val newLineSymbol = System.lineSeparator() 8 | 9 | fun getPictureWidth(picture: String) = picture.lines().maxOfOrNull { it.length } ?: 0 10 | 11 | fun getPictureByName(name: String) = allImages[name] 12 | 13 | fun allPictures() = allImages.keys 14 | -------------------------------------------------------------------------------- /AlmostDone/whenTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Console Photoshop - when Expression 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/Images.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/almost/done/PreDefinedSymbols.kt 9 | visible: false 10 | -------------------------------------------------------------------------------- /AlmostDone/whenTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 957199675 2 | -------------------------------------------------------------------------------- /Chat/askFirstQuestion/src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.chat 2 | 3 | fun main() { 4 | println("Hello! I'm glad to meet you, let me get to know you better! What is your name?") 5 | val name = readlnOrNull() 6 | } 7 | -------------------------------------------------------------------------------- /Chat/askFirstQuestion/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Chat - Ask First Question 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /Chat/askFirstQuestion/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 468192544 2 | -------------------------------------------------------------------------------- /Chat/askFirstQuestion/task.md: -------------------------------------------------------------------------------- 1 | In this task, you will start implementing the project. 2 | 3 | ### Task 4 | 5 | Ask the user the first question: `Hello! I'm glad to meet you, let me get to know you better! What is your name?`, 6 | and then store the user's answer in a variable (you can use any variable name you choose). 7 | 8 | **Note**: to avoid typos, just copy the text from here and paste it into your code. 9 | 10 | If you have any difficulties, **hints will help you solve this task**. 11 | 12 | ---- 13 | 14 | ### Hints 15 | 16 |
17 | 18 | To print a question, you can use the `println` function from the previous steps. 19 | Then, to store the user's input in a variable, you can use the `readlnOrNull` function. 20 | 21 |
22 | -------------------------------------------------------------------------------- /Chat/askFirstQuestion/test/Tests.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.chat.main 2 | import org.junit.jupiter.api.Assertions 3 | import org.junit.jupiter.api.Test 4 | import util.Util 5 | import util.Util.DEFAULT_USER_INPUT 6 | import util.runMainFunction 7 | import org.junit.jupiter.api.extension.ExtendWith 8 | import util.HandleNotImplementedError 9 | import util.HandleNotImplementedErrorExtension 10 | 11 | @HandleNotImplementedError 12 | @ExtendWith(HandleNotImplementedErrorExtension::class) 13 | class Test { 14 | @Test 15 | fun testSolution() { 16 | Assertions.assertEquals( 17 | "Hello! I'm glad to meet you, let me get to know you better! What is your name?${Util.newLineSeparator}", 18 | runMainFunction(::main, "$DEFAULT_USER_INPUT${Util.newLineSeparator}") 19 | ) 20 | } 21 | } -------------------------------------------------------------------------------- /Chat/askSecondQuestion/src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.chat 2 | 3 | fun main() { 4 | println("Hello! I'm glad to meet you, let me get to know you better! What is your name?") 5 | val name = readlnOrNull() 6 | println("Nice to meet you, $name! My name is Kotlin Bot! I am a young programming language created in 2010. How old are you?") 7 | val age = readlnOrNull() 8 | } 9 | -------------------------------------------------------------------------------- /Chat/askSecondQuestion/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Chat - Ask Second Question 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /Chat/askSecondQuestion/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 692295510 2 | -------------------------------------------------------------------------------- /Chat/chatIntro/src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.chat 2 | 3 | fun main() { 4 | // Write your solution here 5 | } 6 | -------------------------------------------------------------------------------- /Chat/chatIntro/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Chat - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt 5 | visible: true 6 | -------------------------------------------------------------------------------- /Chat/chatIntro/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 619115895 2 | -------------------------------------------------------------------------------- /Chat/completeTheProject/src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.chat 2 | 3 | fun main() { 4 | println("Hello! I'm glad to meet you, let me get to know you better! What is your name?") 5 | val name = readlnOrNull() 6 | println("Nice to meet you, $name! My name is Kotlin Bot! I am a young programming language created in 2010. How old are you?") 7 | val age = readlnOrNull() 8 | println("$age is great! I hope you successfully complete this course! Anyone can learn programming at any age!") 9 | } 10 | -------------------------------------------------------------------------------- /Chat/completeTheProject/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Chat - Complete The Project 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/chat/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | 9 | -------------------------------------------------------------------------------- /Chat/completeTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 949232906 2 | -------------------------------------------------------------------------------- /Chat/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | custom_name: Chat 3 | content: 4 | - chatIntro 5 | - askFirstQuestion 6 | - askSecondQuestion 7 | - completeTheProject 8 | is_template_based: false 9 | -------------------------------------------------------------------------------- /Chat/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 734671394 2 | -------------------------------------------------------------------------------- /FeedbackSurvey/Survey/src/Main.kt: -------------------------------------------------------------------------------- 1 | fun main() { 2 | // Write your solution here 3 | } 4 | -------------------------------------------------------------------------------- /FeedbackSurvey/Survey/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | files: 3 | - name: src/Main.kt 4 | visible: true 5 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Feedback+Survey/Survey 6 | -------------------------------------------------------------------------------- /FeedbackSurvey/Survey/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 615480409 2 | -------------------------------------------------------------------------------- /FeedbackSurvey/Survey/task.md: -------------------------------------------------------------------------------- 1 | # Feedback Survey 2 | 3 | Thank you for taking our Kotlin Onboarding: Introduction course! 4 | We would really appreciate it if you could take a few minutes to answer our survey. 5 | Your feedback will help us improve this and further parts of the course and make them more relevant for future students. 6 | The [survey](https://surveys.jetbrains.com/s3/kotlin-onboarding-feedback-survey?part=1) is anonymous and should take no more than 5 minutes to complete. 7 | Stay tuned for more parts of our course coming soon! 8 | 9 |
10 | 11 | If for some reason the survey link is unclickable, you can copy the full link here: 12 | https://surveys.jetbrains.com/s3/kotlin-onboarding-feedback-survey?part=1 13 | 14 |
15 | -------------------------------------------------------------------------------- /FeedbackSurvey/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | custom_name: Feedback Survey 2 | content: 3 | - Survey 4 | -------------------------------------------------------------------------------- /FeedbackSurvey/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 822630104 2 | -------------------------------------------------------------------------------- /Hangman/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/CompleteTheProject/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - Finish The Game 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Hangman/Finish+the+game 17 | -------------------------------------------------------------------------------- /Hangman/CompleteTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1840247486 2 | -------------------------------------------------------------------------------- /Hangman/Core/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/Core/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - generateNewUserWord Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Tests.kt 11 | visible: false 12 | - name: test/Core.kt 13 | visible: false 14 | - name: test/HangmanTestUtil.kt 15 | visible: false 16 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Hangman/Core 17 | -------------------------------------------------------------------------------- /Hangman/Core/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1948062985 2 | -------------------------------------------------------------------------------- /Hangman/CreateTheGame/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/CreateTheGame/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Hangman - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Hangman/Create+the+game 11 | -------------------------------------------------------------------------------- /Hangman/CreateTheGame/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 2128193824 2 | -------------------------------------------------------------------------------- /Hangman/generateSecretFunction/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/generateSecretFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - generateSecret Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /Hangman/generateSecretFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1479688163 2 | -------------------------------------------------------------------------------- /Hangman/generateSecretFunction/task.md: -------------------------------------------------------------------------------- 1 | The goal of this task is to generate a random word for the game. 2 | 3 | ### Task 4 | 5 | Implement the `generateSecret` function, which generates a _random_ word from the `words` list. 6 | 7 |
8 | 9 | The signature of the function is: 10 | ```kotlin 11 | fun generateSecret(): String 12 | ``` 13 |
14 | 15 | This project already has a defined variable `words` with a list of words that are available for the game. 16 | You just need to generate a _random_ element from this list. 17 | To check which words are stored in the `words` list, you can print the elements: 18 | ```kotlin 19 | println(words) // [AREA, BABY, BACK, BALL, BAND, BANK, BASE, BODY, BOOK, ... ] 20 | ``` 21 | -------------------------------------------------------------------------------- /Hangman/getHiddenSecretFunction/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/getHiddenSecretFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - getHiddenSecret Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /Hangman/getHiddenSecretFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 2085825446 2 | -------------------------------------------------------------------------------- /Hangman/getRoundResultsFunction/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/getRoundResultsFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - getRoundResults Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /Hangman/getRoundResultsFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1284940740 2 | -------------------------------------------------------------------------------- /Hangman/isCompleteFunction/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/isCompleteFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - isComplete Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /Hangman/isCompleteFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 316297317 2 | -------------------------------------------------------------------------------- /Hangman/isCorrectInputFunction/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/isCorrectInputFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - isCorrectInput Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /Hangman/isCorrectInputFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1166766094 2 | -------------------------------------------------------------------------------- /Hangman/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | content: 3 | - CreateTheGame 4 | - isCompleteFunction 5 | - Core 6 | - generateSecretFunction 7 | - getHiddenSecretFunction 8 | - isCorrectInputFunction 9 | - safeUserInputFunction 10 | - getRoundResultsFunction 11 | - CompleteTheProject 12 | is_template_based: false 13 | -------------------------------------------------------------------------------- /Hangman/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 471158885 2 | -------------------------------------------------------------------------------- /Hangman/safeUserInputFunction/src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.hangman 4 | 5 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 6 | 7 | val separator = " " 8 | val underscore = "_" 9 | 10 | val wordLength = 4 11 | val maxAttemptsCount = wordLength * 2 12 | 13 | val newLineSymbol: String = System.lineSeparator() 14 | -------------------------------------------------------------------------------- /Hangman/safeUserInputFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Hangman - safeUserInput Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Util.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/hangman/Words.kt 9 | visible: false 10 | - name: test/Core.kt 11 | visible: false 12 | - name: test/HangmanTestUtil.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /Hangman/safeUserInputFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 85088674 2 | -------------------------------------------------------------------------------- /Introduction/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | is_template_based: false 3 | content: 4 | - welcome 5 | -------------------------------------------------------------------------------- /Introduction/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1412220528 2 | -------------------------------------------------------------------------------- /Introduction/welcome/src/main/kotlin/jetbrains/kotlin/course/welcome/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.welcome 2 | 3 | fun main() { 4 | // Write your solution here 5 | } 6 | -------------------------------------------------------------------------------- /Introduction/welcome/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Kotlin Onboarding - Welcome! 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/welcome/Main.kt 5 | visible: true 6 | -------------------------------------------------------------------------------- /Introduction/welcome/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1676423900 2 | -------------------------------------------------------------------------------- /LastPush/CanvasGapsGenerator/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/CanvasGapsGenerator/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 919228894 2 | -------------------------------------------------------------------------------- /LastPush/CanvasGapsGenerator/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/CanvasGapsGenerator/test/DropTopLine.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.last.push.ball 2 | import jetbrains.kotlin.course.last.push.cube 3 | import jetbrains.kotlin.course.last.push.robot 4 | import org.junit.jupiter.params.provider.Arguments 5 | 6 | 7 | internal val dropTopLineData = listOf( 8 | // pattern, expected 9 | Arguments.of( 10 | ball, ball 11 | ), 12 | Arguments.of( 13 | robot, 14 | """ 15 | | o o | 16 | | ^ | 17 | | --- | 18 | +---+---+ 19 | """.trimIndent() 20 | ), 21 | Arguments.of( 22 | cube, 23 | """ 24 | .' | .'| 25 | +---+--+' | 26 | | | | | 27 | | ,+--+---+ 28 | |.' | .' 29 | +------+' 30 | """.trimIndent() 31 | ), 32 | ) -------------------------------------------------------------------------------- /LastPush/CanvasGapsGenerator/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | canvasWithGapsGeneratorMethod, 7 | canvasGeneratorMethod, 8 | fillPatternRowMethod, 9 | getPatternHeightMethod, 10 | repeatHorizontallyMethod, 11 | dropTopLineMethod 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /LastPush/CanvasGenerator/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/CanvasGenerator/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 15384542 2 | -------------------------------------------------------------------------------- /LastPush/CanvasGenerator/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/CanvasGenerator/test/DropTopLine.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.last.push.ball 2 | import jetbrains.kotlin.course.last.push.cube 3 | import jetbrains.kotlin.course.last.push.robot 4 | import org.junit.jupiter.params.provider.Arguments 5 | 6 | 7 | internal val dropTopLineData = listOf( 8 | // pattern, expected 9 | Arguments.of( 10 | ball, ball 11 | ), 12 | Arguments.of( 13 | robot, 14 | """ 15 | | o o | 16 | | ^ | 17 | | --- | 18 | +---+---+ 19 | """.trimIndent() 20 | ), 21 | Arguments.of( 22 | cube, 23 | """ 24 | .' | .'| 25 | +---+--+' | 26 | | | | | 27 | | ,+--+---+ 28 | |.' | .' 29 | +------+' 30 | """.trimIndent() 31 | ), 32 | ) -------------------------------------------------------------------------------- /LastPush/CanvasGenerator/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | canvasGeneratorMethod, 7 | fillPatternRowMethod, 8 | getPatternHeightMethod, 9 | repeatHorizontallyMethod, 10 | dropTopLineMethod 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /LastPush/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/CompleteTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1120394004 2 | -------------------------------------------------------------------------------- /LastPush/CompleteTheProject/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/CompleteTheProject/test/DropTopLine.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.last.push.ball 2 | import jetbrains.kotlin.course.last.push.cube 3 | import jetbrains.kotlin.course.last.push.robot 4 | import org.junit.jupiter.params.provider.Arguments 5 | 6 | 7 | internal val dropTopLineData = listOf( 8 | // pattern, expected 9 | Arguments.of( 10 | ball, ball 11 | ), 12 | Arguments.of( 13 | robot, 14 | """ 15 | | o o | 16 | | ^ | 17 | | --- | 18 | +---+---+ 19 | """.trimIndent() 20 | ), 21 | Arguments.of( 22 | cube, 23 | """ 24 | .' | .'| 25 | +---+--+' | 26 | | | | | 27 | | ,+--+---+ 28 | |.' | .' 29 | +------+' 30 | """.trimIndent() 31 | ), 32 | ) -------------------------------------------------------------------------------- /LastPush/CompleteTheProject/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | fillPatternRowMethod, 7 | getPatternHeightMethod, 8 | canvasGeneratorMethod, 9 | canvasWithGapsGeneratorMethod, 10 | applyGeneratorMethod, 11 | getPatternMethod, 12 | repeatHorizontallyMethod, 13 | dropTopLineMethod 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /LastPush/CompleteTheProject/test/Methods.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val applyGeneratorMethod = TestMethod( 6 | "applyGenerator", TestKotlinType("String"), listOf( 7 | TestVariable("pattern", "String"), 8 | TestVariable("generatorName", "String"), 9 | TestVariable("width", "Int"), 10 | TestVariable("height", "Int"), 11 | ) 12 | ) 13 | 14 | internal val getPatternMethod = TestMethod("getPattern", TestKotlinType("String")) 15 | -------------------------------------------------------------------------------- /LastPush/Helpers/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/Helpers/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 857708508 2 | -------------------------------------------------------------------------------- /LastPush/Helpers/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/Helpers/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | fillPatternRowMethod, 7 | getPatternHeightMethod, 8 | ) 9 | ) 10 | -------------------------------------------------------------------------------- /LastPush/PatternsGenerator/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/PatternsGenerator/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Patterns Generator - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/Patterns.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Last+push/Patterns+generator+projects 11 | -------------------------------------------------------------------------------- /LastPush/PatternsGenerator/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 792095342 2 | -------------------------------------------------------------------------------- /LastPush/dropTopLineFunction/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/dropTopLineFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1240099384 2 | -------------------------------------------------------------------------------- /LastPush/dropTopLineFunction/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/dropTopLineFunction/test/DropTopLine.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.last.push.ball 2 | import jetbrains.kotlin.course.last.push.cube 3 | import jetbrains.kotlin.course.last.push.robot 4 | import org.junit.jupiter.params.provider.Arguments 5 | 6 | 7 | internal val dropTopLineData = listOf( 8 | // pattern, expected 9 | Arguments.of( 10 | ball, ball 11 | ), 12 | Arguments.of( 13 | robot, 14 | """ 15 | | o o | 16 | | ^ | 17 | | --- | 18 | +---+---+ 19 | """.trimIndent() 20 | ), 21 | Arguments.of( 22 | cube, 23 | """ 24 | .' | .'| 25 | +---+--+' | 26 | | | | | 27 | | ,+--+---+ 28 | |.' | .' 29 | +------+' 30 | """.trimIndent() 31 | ), 32 | ) -------------------------------------------------------------------------------- /LastPush/dropTopLineFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | fillPatternRowMethod, 7 | getPatternHeightMethod, 8 | repeatHorizontallyMethod, 9 | dropTopLineMethod 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /LastPush/getPatternHeightFunction/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/getPatternHeightFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Patterns Generator - getPatternHeight Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/Patterns.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt 9 | visible: false 10 | - name: test/CanvasGenerator.kt 11 | visible: false 12 | - name: test/CanvasWithGapsGenerator.kt 13 | visible: false 14 | - name: test/Helpers.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | - name: test/PatternsGeneratorTestsUtils.kt 19 | visible: false 20 | - name: test/Tests.kt 21 | visible: false 22 | -------------------------------------------------------------------------------- /LastPush/getPatternHeightFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 694346756 2 | -------------------------------------------------------------------------------- /LastPush/getPatternHeightFunction/task.md: -------------------------------------------------------------------------------- 1 | Let's start practicing! 2 | 3 | ### Task 4 | 5 | Implement the `getPatternHeight` function, which accepts a `pattern` and calculates its height. 6 | 7 |
8 | 9 | The signature of the function is: 10 | ```kotlin 11 | fun getPatternHeight(pattern: String): Int 12 | ``` 13 |
14 | 15 | If you have any difficulties, **hints will help you solve this task**. 16 | 17 | ---- 18 | 19 | ### Hints 20 | 21 |
22 | 23 | The pattern height can be calculated as the number of _lines_ in the pattern. 24 |
25 | -------------------------------------------------------------------------------- /LastPush/getPatternHeightFunction/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/getPatternHeightFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | fillPatternRowMethod, 7 | getPatternHeightMethod, 8 | ) 9 | ) 10 | -------------------------------------------------------------------------------- /LastPush/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | custom_name: Last push 3 | content: 4 | - PatternsGenerator 5 | - getPatternHeightFunction 6 | - Helpers 7 | - repeatHorizontallyFunction 8 | - dropTopLineFunction 9 | - CanvasGenerator 10 | - CanvasGapsGenerator 11 | - CompleteTheProject 12 | is_template_based: false 13 | -------------------------------------------------------------------------------- /LastPush/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1709046670 2 | -------------------------------------------------------------------------------- /LastPush/repeatHorizontallyFunction/src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("MayBeConst") 2 | 3 | package jetbrains.kotlin.course.last.push 4 | 5 | val separator = ' ' 6 | val newLineSymbol = System.lineSeparator() 7 | 8 | fun getPatternWidth(pattern: String) = pattern.lines().maxOfOrNull { it.length } ?: 0 9 | 10 | fun getPatternByName(name: String) = allPatternsMap[name] 11 | 12 | fun allPatterns() = allPatternsMap.keys 13 | -------------------------------------------------------------------------------- /LastPush/repeatHorizontallyFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Patterns Generator - repeatHorizontally Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/Patterns.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/last/push/PreDefinedSymbols.kt 9 | visible: false 10 | - name: test/CanvasGenerator.kt 11 | visible: false 12 | - name: test/CanvasWithGapsGenerator.kt 13 | visible: false 14 | - name: test/Helpers.kt 15 | visible: false 16 | - name: test/MainClass.kt 17 | visible: false 18 | - name: test/PatternsGeneratorTestsUtils.kt 19 | visible: false 20 | - name: test/Tests.kt 21 | visible: false 22 | -------------------------------------------------------------------------------- /LastPush/repeatHorizontallyFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 459293849 2 | -------------------------------------------------------------------------------- /LastPush/repeatHorizontallyFunction/test/CanvasWithGapsGenerator.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val canvasWithGapsGeneratorMethod = TestMethod( 6 | "canvasWithGapsGenerator", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("pattern", "String"), 10 | TestVariable("width", "Int"), 11 | TestVariable("height", "Int"), 12 | ), 13 | ) 14 | 15 | internal fun canvasWithGaps() = Pattern.values() 16 | .flatMap { f -> f.canvasWithGapsFilters.map { f.pattern to it } } 17 | -------------------------------------------------------------------------------- /LastPush/repeatHorizontallyFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.last.push", 5 | customMethods = listOf( 6 | fillPatternRowMethod, 7 | getPatternHeightMethod, 8 | repeatHorizontallyMethod 9 | ) 10 | ) 11 | -------------------------------------------------------------------------------- /MastermindAdvanced/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/CompleteTheProject/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind Advanced - Finish The Game 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/MastermindTestUtil.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /MastermindAdvanced/CompleteTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1477657219 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/CompleteTheProject/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.mastermind.advanced", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | isWinMethod, 10 | isLostMethod, 11 | generateSecretMethod, 12 | getGameRulesMethod, 13 | printRoundResultsMethod, 14 | isCorrectInputMethod, 15 | safeUserInputMethod, 16 | playGameMethod 17 | ), 18 | ) 19 | -------------------------------------------------------------------------------- /MastermindAdvanced/errorHandling/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/errorHandling/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind Advanced - Error Handling 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /MastermindAdvanced/errorHandling/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1632845494 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/generateSecretFunction/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/generateSecretFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind Advanced - generateSecret Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/MastermindTestUtil.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /MastermindAdvanced/generateSecretFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 512051311 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/generateSecretFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.mastermind.advanced", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | isWinMethod, 10 | isLostMethod, 11 | generateSecretMethod, 12 | getGameRulesMethod, 13 | printRoundResultsMethod, 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /MastermindAdvanced/generateSecretFunction/test/MastermindTestUtil.kt: -------------------------------------------------------------------------------- 1 | import util.Util 2 | 3 | internal const val SECRET = "ABCD" 4 | internal const val WORD_LENGTH = 4 5 | 6 | data class GameStep( 7 | val attempt: String, 8 | val positions: Int, 9 | val letters: Int 10 | ) { 11 | companion object { 12 | private const val welcomeMessage = "Please input your guess. It should be of length $WORD_LENGTH." 13 | } 14 | 15 | fun imitateGameProcess() = "$welcomeMessage${Util.newLineSeparator}Your guess has $positions full matches, and $letters partial matches." 16 | } 17 | -------------------------------------------------------------------------------- /MastermindAdvanced/introduction/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/introduction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind Advanced - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /MastermindAdvanced/introduction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 68121813 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/isCorrectInputFunction/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/isCorrectInputFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind Advanced - isCorrectInput Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/MastermindTestUtil.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /MastermindAdvanced/isCorrectInputFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1290076994 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/isCorrectInputFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.mastermind.advanced", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | isWinMethod, 10 | isLostMethod, 11 | generateSecretMethod, 12 | getGameRulesMethod, 13 | printRoundResultsMethod, 14 | isCorrectInputMethod 15 | ), 16 | ) 17 | -------------------------------------------------------------------------------- /MastermindAdvanced/joinToStringFunction/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/joinToStringFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind Advanced - joinToString Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /MastermindAdvanced/joinToStringFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1725484953 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/joinToStringFunction/task.md: -------------------------------------------------------------------------------- 1 | We have already learned how to generate a list of random letters, but we need to work with strings. 2 | To join a list of elements into a string, 3 | you can use the [`joinToString`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/join-to-string.html) 4 | function, passing the _separator_ — a character (or _string_) 5 | that will be used to separate the elements — as an argument.: 6 | ```kotlin 7 | // The separator is "; ", the resulting string is: "6; 6; 6; 6; 6" 8 | List(5) { 6 }.joinToString("; ") 9 | // The default separator is ", ", the resulting string is: "A, A, A, A, A" 10 | List(5) { 'A' }.joinToString() 11 | ``` 12 | -------------------------------------------------------------------------------- /MastermindAdvanced/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | custom_name: Mastermind Advanced 3 | content: 4 | - introduction 5 | - randomFunction 6 | - joinToStringFunction 7 | - generateSecretFunction 8 | - errorHandling 9 | - isCorrectInputFunction 10 | - safeUserInputFunction 11 | - CompleteTheProject 12 | is_template_based: false 13 | -------------------------------------------------------------------------------- /MastermindAdvanced/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 541942201 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/randomFunction/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/randomFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind Advanced - Random Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /MastermindAdvanced/randomFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1229753076 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/safeUserInputFunction/src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.mastermind.advanced 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /MastermindAdvanced/safeUserInputFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind Advanced - safeUserInput Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/mastermind/advanced/Util.kt 7 | visible: false 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/MastermindTestUtil.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | -------------------------------------------------------------------------------- /MastermindAdvanced/safeUserInputFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1826732352 2 | -------------------------------------------------------------------------------- /MastermindAdvanced/safeUserInputFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.mastermind.advanced", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | isWinMethod, 10 | isLostMethod, 11 | generateSecretMethod, 12 | getGameRulesMethod, 13 | printRoundResultsMethod, 14 | isCorrectInputMethod, 15 | safeUserInputMethod 16 | ), 17 | ) 18 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/BuiltinFunctions/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | } 7 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/BuiltinFunctions/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/BuiltinFunctions/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Story twister - Start the Game 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/The+first+day+with+programming/Built-in+functions 11 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/BuiltinFunctions/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1762576790 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/BuiltinFunctions/task.md: -------------------------------------------------------------------------------- 1 | Let's start implementing our **Story twister** project. Let's first print an introduction to the user. 2 | 3 |
4 | 5 | ![The game's example](../../utils/src/main/resources/images/part1/first.date/game.gif "The game's example") 6 | 7 |
8 | 9 | ### Task 10 | 11 | Print the following text using the `print` or `println` function: 12 | ```text 13 | Hello! I will ask you several questions. 14 | Please answer all of them and be honest with me! 15 | ``` 16 | 17 | **Note**: to avoid typos, just copy the text from here and paste it into your code. 18 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/BuiltinFunctions/test/Tests.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.first.date.main 2 | import org.junit.jupiter.api.Assertions 3 | import org.junit.jupiter.api.Test 4 | import util.Util 5 | import util.runMainFunction 6 | import org.junit.jupiter.api.extension.ExtendWith 7 | import util.HandleNotImplementedError 8 | import util.HandleNotImplementedErrorExtension 9 | 10 | @HandleNotImplementedError 11 | @ExtendWith(HandleNotImplementedErrorExtension::class) 12 | class Test { 13 | @Test 14 | fun testSolution() { 15 | Assertions.assertEquals( 16 | "Hello! I will ask you several questions.${Util.newLineSeparator}" + 17 | "Please answer all of them and be honest with me!${Util.newLineSeparator}", 18 | runMainFunction(::main) 19 | ) 20 | } 21 | } -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | println("What is TROTEN?") 7 | val firstUserAnswer = readlnOrNull() 8 | println("How did you spend your graduation?") 9 | val secondUserAnswer = readlnOrNull() 10 | println("Why does a spider need eight legs?") 11 | val thirdUserAnswer = readlnOrNull() 12 | println("Now let's have fun!") 13 | println(firstQuestion) 14 | println(firstUserAnswer) 15 | println(secondQuestion) 16 | println(secondUserAnswer) 17 | println(thirdQuestion) 18 | println(thirdUserAnswer) 19 | } 20 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/CompleteTheProject/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Story twister - Complete the Project 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 9 | visible: true 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/The+first+day+with+programming/Complete+the+Project 11 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/CompleteTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1021356481 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Introduction/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("My first program!") 5 | } 6 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Introduction/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Introduction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Story twister - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 7 | visible: false 8 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/The+first+day+with+programming/Introduction 9 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Introduction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 214162757 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Introduction/task.md: -------------------------------------------------------------------------------- 1 |

2 | Story twister 3 |

4 | 5 | ### Project description 6 | 7 | The project of this lesson is **Story twister**. 8 | The goal of this game is to ask the user several fake questions, 9 | remember the answers, and then reveal the real questions to build a fun story from these answers. 10 | 11 | ### Lesson topics 12 | 13 | - the entry point for a Kotlin program; 14 | - built-in functions for printing to console; 15 | - variables; 16 | - built-in functions for reading user input. 17 | 18 | ### Project example 19 | 20 | ![The game's example](../../utils/src/main/resources/images/part1/first.date/game.gif "The game's example") 21 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ProgramEntryPoint/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello!") 5 | } 6 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ProgramEntryPoint/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ProgramEntryPoint/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Story twister - First Kotlin Program 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/The+first+day+with+programming/Program+entry+point 11 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ProgramEntryPoint/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1412191977 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ProgramEntryPoint/task.md: -------------------------------------------------------------------------------- 1 | It's time to write your first program in Kotlin! 2 | 3 | ### Task 4 | 5 | Change the output text into `Hello!` and run the program. 6 | 7 |
8 | 9 | To run your program, you need to open the `Main.kt` file and click on the **green triangle** near the `main` function. 10 | Then, the output of the program will be shown in the console: 11 | 12 | ![Program entry point and console](../../utils/src/main/resources/images/part1/first.date/run_example.gif "Program entry point and console") 13 | 14 |
15 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ProgramEntryPoint/test/Tests.kt: -------------------------------------------------------------------------------- 1 | import jetbrains.kotlin.course.first.date.main 2 | import org.junit.jupiter.api.Assertions 3 | import org.junit.jupiter.api.Test 4 | import org.junit.jupiter.api.extension.ExtendWith 5 | import util.HandleNotImplementedError 6 | import util.HandleNotImplementedErrorExtension 7 | import util.Util 8 | import util.runMainFunction 9 | 10 | @HandleNotImplementedError 11 | @ExtendWith(HandleNotImplementedErrorExtension::class) 12 | class Test { 13 | @Test 14 | fun testSolution() { 15 | Assertions.assertEquals("Hello!${Util.newLineSeparator}", runMainFunction(::main)) 16 | } 17 | } -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ReadUserInput/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | println("What is TROTEN?") 7 | val firstUserAnswer = readlnOrNull() 8 | println("How did you spend your graduation?") 9 | val secondUserAnswer = readlnOrNull() 10 | println("Why does a spider need eight legs?") 11 | val thirdUserAnswer = readlnOrNull() 12 | } 13 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ReadUserInput/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ReadUserInput/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Story twister - Read user input, Practice 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/The+first+day+with+programming/Read+User+Input 11 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/ReadUserInput/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 172830079 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Variables/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | val firstUserAnswer = "" 7 | val secondUserAnswer = "" 8 | val thirdUserAnswer = "" 9 | } 10 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Variables/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Variables/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Story twister - Variables, Practice 3 | files: 4 | - name: test/Tests.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 7 | visible: true 8 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 9 | visible: false 10 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/The+first+day+with+programming/Variables 11 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Variables/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 410448577 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/Variables/task.md: -------------------------------------------------------------------------------- 1 | In this task, we will add variables to store the user's answers. 2 | 3 | ### Task 4 | 5 | Add empty `String` variables to hold the user's answers, named 6 | _firstUserAnswer_, _secondUserAnswer_, and _thirdUserAnswer_. 7 | 8 | If you have any difficulties, **hints will help you solve this task**. 9 | 10 | ---- 11 | 12 | ### Hints 13 | 14 |
15 | 16 | In the current task, it is better to use the `val` keyword, since we will just _save_ values from the user 17 | into the variables and will not change them afterwards. 18 | 19 |
20 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/builtinFunctionsTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello!") 5 | } 6 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/builtinFunctionsTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/builtinFunctionsTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Story twister - Built-in Functions 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/builtinFunctionsTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 563522277 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/comments/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | println("What is TROTEN?") 7 | val firstUserAnswer = readlnOrNull() 8 | println("How did you spend your graduation?") 9 | val secondUserAnswer = readlnOrNull() 10 | println("Why does a spider need eight legs?") 11 | val thirdUserAnswer = readlnOrNull() 12 | } 13 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/comments/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/comments/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Story twister - Comments 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/comments/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 398217788 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/comments/task.md: -------------------------------------------------------------------------------- 1 | Congratulations, you've almost finished your first project! 2 | 3 | Let me share a little trick on how you can write [comments](https://kotlinlang.org/docs/basic-syntax.html#comments) 4 | for other developers (or for yourself) in your code. 5 | To do this, use a double slash at the beginning of the code line: 6 | ```kotlin 7 | fun main() { 8 | // My comment, I can write whatever I want here 9 | } 10 | ``` 11 | Comments are usually left for the most complex parts of code, 12 | making it easier to understand their functions later on. 13 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | custom_name: The first date with programming 3 | content: 4 | - Introduction 5 | - programEntryPointTheory 6 | - ProgramEntryPoint 7 | - builtinFunctionsTheory 8 | - BuiltinFunctions 9 | - variablesTheory 10 | - Variables 11 | - readUserInputTheory 12 | - ReadUserInput 13 | - comments 14 | - CompleteTheProject 15 | is_template_based: false 16 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 599627186 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/programEntryPointTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("My first program!") 5 | } 6 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/programEntryPointTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/programEntryPointTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Story twister - Program Entry Point 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/programEntryPointTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1843240451 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/readUserInputTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | val firstUserAnswer = "" 7 | val secondUserAnswer = "" 8 | val thirdUserAnswer = "" 9 | } 10 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/readUserInputTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/readUserInputTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Story twister - Read user input, Theory 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/readUserInputTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 378596203 2 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/variablesTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.first.date 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.") 5 | println("Please answer all of them and be honest with me!") 6 | } 7 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/variablesTheory/src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("TopLevelPropertyNaming") 2 | 3 | package jetbrains.kotlin.course.first.date 4 | 5 | const val firstQuestion = "What is Kotlin?" 6 | const val secondQuestion = "How was Kotlin invented?" 7 | const val thirdQuestion = "Why are you learning Kotlin?" 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/variablesTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Story twister - Variables, Theory 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/first/date/RealQuestions.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /TheFirstDateWithProgramming/variablesTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 604688510 2 | -------------------------------------------------------------------------------- /WarmUp/Collections/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/Collections/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - countExactMatches Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/MainClass.kt 13 | visible: false 14 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Collections 15 | -------------------------------------------------------------------------------- /WarmUp/Collections/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1651787790 2 | -------------------------------------------------------------------------------- /WarmUp/Collections/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 4 | 5 | internal val mainClass = TestClass( 6 | classPackage = "jetbrains.kotlin.course.warmup", 7 | customMethods = listOf( 8 | isCompleteMethod, 9 | countExactMatchesMethod, 10 | generateSecretMethod, 11 | getGameRulesMethod, 12 | countPartialMatchesMethod, 13 | playGameMethod 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /WarmUp/CollectionsPartTwo/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/CollectionsPartTwo/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - countAllMatches Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: test/Tests.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 9 | visible: true 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/MainClass.kt 13 | visible: false 14 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Collections+part+two 15 | -------------------------------------------------------------------------------- /WarmUp/CollectionsPartTwo/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 912657372 2 | -------------------------------------------------------------------------------- /WarmUp/CollectionsPartTwo/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | generateSecretMethod, 10 | getGameRulesMethod, 11 | countAllMatches, 12 | playGameMethod 13 | ), 14 | ) 15 | -------------------------------------------------------------------------------- /WarmUp/CompleteTheProject/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/CompleteTheProject/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - Finish Base Game 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: true 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/MastermindTestUtil.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | - name: test/Tests.kt 15 | visible: false 16 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Finish+the+game 17 | -------------------------------------------------------------------------------- /WarmUp/CompleteTheProject/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1278662430 2 | -------------------------------------------------------------------------------- /WarmUp/CompleteTheProject/task.md: -------------------------------------------------------------------------------- 1 | Hurrah! In this task we will finish the base game. 2 | 3 | ### Task 4 | 5 | Modify the `playGame` function: add a variable that counts the number of the user's attempts. 6 | We need to count the attempts from zero, which means the user can try to guess the secret `maxAttemptsCount` + 1 times. 7 | The `playGame` function should print the following messages to inform the user: `Sorry, you lost! :( My word is ` and `Congratulations! You guessed it!`. 8 | Use `isWon` and `isLost` from the previous steps inside the loop to check the current game state. 9 | 10 | Before each question to the user please use `Please input your guess. It should be of length .` text. 11 | 12 | **Note**: to avoid typos just copy the text from here and paste into your code. 13 | 14 | -------------------------------------------------------------------------------- /WarmUp/CompleteTheProject/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | isWinMethod, 10 | isLostMethod, 11 | generateSecretMethod, 12 | printRoundResultsMethod, 13 | getGameRulesMethod, 14 | playGameMethod 15 | ), 16 | ) 17 | -------------------------------------------------------------------------------- /WarmUp/CustomFunctions/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/CustomFunctions/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - Add First Custom Functions 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/MainClass.kt 13 | visible: false 14 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Custom+functions 15 | -------------------------------------------------------------------------------- /WarmUp/CustomFunctions/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 21668245 2 | -------------------------------------------------------------------------------- /WarmUp/CustomFunctions/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | getGameRulesMethod, 7 | generateSecretMethod, 8 | countPartialMatchesMethod, 9 | countExactMatchesMethod, 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /WarmUp/If/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/If/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - Finish isComplete Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/MainClass.kt 13 | visible: false 14 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/If 15 | -------------------------------------------------------------------------------- /WarmUp/If/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 13109812 2 | -------------------------------------------------------------------------------- /WarmUp/If/task.md: -------------------------------------------------------------------------------- 1 | In this task we will implement the `isComplete` function, since the current implementation always returns `true`. 2 | 3 | ### Task 4 | 5 | Implement the `isComplete` function. It should return `true` 6 | if `secret` and `guess` are the same and `false` otherwise. 7 | 8 | If you have any difficulties, **hints will help you solve this task**. 9 | 10 | ---- 11 | 12 | ### Hints 13 | 14 |
15 | 16 | If you compare two variables to get a `Boolean` result, you can use the short notation. 17 | For example, the following code: 18 | ``` 19 | fun isNotEqual(a: Int, b: Int) = if (a != b) { 20 | true 21 | } else { 22 | false 23 | } 24 | ``` 25 | can be replaced with this one: 26 | ``` 27 | fun isNotEqual(a: Int, b: Int) = a != b 28 | ``` 29 |
30 | -------------------------------------------------------------------------------- /WarmUp/If/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | playGameMethod, 8 | getGameRulesMethod, 9 | generateSecretMethod, 10 | countPartialMatchesMethod, 11 | countExactMatches, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /WarmUp/Introduction/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/Introduction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Introduction 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Introduction 9 | -------------------------------------------------------------------------------- /WarmUp/Introduction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1444969308 2 | -------------------------------------------------------------------------------- /WarmUp/Loops/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/Loops/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - Play Game Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | - name: test/Tests.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/MainClass.kt 13 | visible: false 14 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Loops 15 | -------------------------------------------------------------------------------- /WarmUp/Loops/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1441227087 2 | -------------------------------------------------------------------------------- /WarmUp/Loops/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | generateSecretMethod, 8 | playGameMethod, 9 | getGameRulesMethod, 10 | countPartialMatchesMethod, 11 | countExactMatchesMethod, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /WarmUp/TypesOfVariables/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/TypesOfVariables/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - Variables for Game Settings 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: test/Tests.kt 7 | visible: false 8 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/MainClass.kt 13 | visible: false 14 | feedback_link: https://docs.google.com/forms/d/e/1FAIpQLScylICclQIi9_YDjO7iuyRITDLn0Qgzw_aLxKxiishKAbL0qg/viewform?usp=pp_url&entry.2103429047=Introduction/Warm+up/Types+of+variables 15 | -------------------------------------------------------------------------------- /WarmUp/TypesOfVariables/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 436171823 2 | -------------------------------------------------------------------------------- /WarmUp/TypesOfVariables/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | getGameRulesMethod, 7 | ), 8 | ) 9 | -------------------------------------------------------------------------------- /WarmUp/TypesOfVariables/test/Methods.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.TestKotlinType 2 | import org.jetbrains.academy.test.system.core.models.method.TestMethod 3 | import org.jetbrains.academy.test.system.core.models.variable.TestVariable 4 | 5 | internal val getGameRulesMethod = TestMethod( 6 | "getGameRules", 7 | TestKotlinType("String"), 8 | listOf( 9 | TestVariable("wordLength", "Int"), 10 | TestVariable("maxAttemptsCount", "Int"), 11 | TestVariable("secretExample", "String"), 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /WarmUp/breakExpression/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/breakExpression/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Break Expression 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | -------------------------------------------------------------------------------- /WarmUp/breakExpression/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1972483715 2 | -------------------------------------------------------------------------------- /WarmUp/breakExpression/task.md: -------------------------------------------------------------------------------- 1 | If you are working with a loop (whether `for` or `while`), 2 | you can stop it earlier with a special [`break`](https://kotlinlang.org/docs/returns.html) expression: 3 | ```kotlin 4 | while (x > 0) { 5 | // to do something 6 | if (x == 10) { 7 | break // break the loop 8 | } 9 | } 10 | ``` 11 | -------------------------------------------------------------------------------- /WarmUp/compositeIf/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/compositeIf/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Boolean Operators 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | -------------------------------------------------------------------------------- /WarmUp/compositeIf/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 540878076 2 | -------------------------------------------------------------------------------- /WarmUp/compositeIf/task.md: -------------------------------------------------------------------------------- 1 | For complex conditions in `if` expressions, 2 | special [built-in operators](https://kotlinlang.org/docs/booleans.html) `||` or `&&` can be used: 3 | `||` is true if _at least one_ condition is true; 4 | `&&` is true if _all_ the conditions are true: 5 | ```kotlin 6 | // Will be true if x > 5 OR y > 5, e.g., x = 3, y = 6 (true) or x = 6, y = 6 (true) 7 | if (x > 5 || y > 5) { 8 | TODO("Not implemented yet") 9 | } 10 | ``` 11 | ```kotlin 12 | // Will be true if x > 5 AND y > 5, e.g., for x = 3, y = 6 (false) or x = 6, y = 6 (true) 13 | if (x > 5 && y > 5) { 14 | TODO("Not implemented yet") 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /WarmUp/compositeOperators/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/compositeOperators/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Composite If Operators 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | -------------------------------------------------------------------------------- /WarmUp/compositeOperators/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1019379491 2 | -------------------------------------------------------------------------------- /WarmUp/compositeOperators/task.md: -------------------------------------------------------------------------------- 1 | An `if` expression can have more than two `if..else` branches: there may also be some intermediate ones: 2 | ```kotlin 3 | if (x > 0) { 4 | TODO("Not implemented yet") 5 | } else if (x == 0) { 6 | TODO("Not implemented yet") 7 | } 8 | ``` 9 | Another example: 10 | ```kotlin 11 | if (x > 0) { 12 | TODO("Not implemented yet") 13 | } else if (x == 0) { 14 | TODO("Not implemented yet") 15 | } else if (x < 0 && x != 5) { 16 | TODO("Not implemented yet") 17 | } else { 18 | TODO("Not implemented yet") 19 | } 20 | ``` 21 | -------------------------------------------------------------------------------- /WarmUp/countPartialMatches/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/countPartialMatches/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - countPartialMatches Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/Tests.kt 13 | visible: false 14 | -------------------------------------------------------------------------------- /WarmUp/countPartialMatches/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 215738047 2 | -------------------------------------------------------------------------------- /WarmUp/countPartialMatches/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | generateSecretMethod, 10 | getGameRulesMethod, 11 | countAllMatches, 12 | playGameMethod 13 | ), 14 | ) 15 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheory/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Custom Functions 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1006365197 2 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheoryPartTwo/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheoryPartTwo/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Functions as Expressions 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheoryPartTwo/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 964908412 2 | -------------------------------------------------------------------------------- /WarmUp/customFunctionsTheoryPartTwo/task.md: -------------------------------------------------------------------------------- 1 | If a function can be expressed in [one statement](https://kotlinlang.org/docs/idioms.html#single-expression-functions) (one action in the code), 2 | the `return` keyword, the type of the return value, and curly braces can be omitted. For example, consider the following code: 3 | ```kotlin 4 | fun myName(intVariable: Int): Int { 5 | return intVariable + 5 6 | } 7 | ``` 8 | It is equivalent to: 9 | ```kotlin 10 | fun myName(intVariable: Int) = intVariable + 5 11 | ``` 12 | 13 | These functions usually help to make code shorter and write code in more Kotlin-like style. 14 | -------------------------------------------------------------------------------- /WarmUp/ifDefinition/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/ifDefinition/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Conditional Operator 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/ifDefinition/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 990585351 2 | -------------------------------------------------------------------------------- /WarmUp/ifDefinition/task.md: -------------------------------------------------------------------------------- 1 | The conditional operator (the [`if`](https://kotlinlang.org/docs/control-flow.html#if-expression) expression) 2 | is used when the program has some choice. 3 | For example, if the variable contains a positive number, display it on the screen, 4 | otherwise do nothing. 5 | Or, if the guess matches the secret, end the game. 6 | 7 | Consider the following example: 8 | ```kotlin 9 | if (y > 0) { 10 | println(y) 11 | } 12 | ``` 13 | Another example: 14 | ```kotlin 15 | if (x > y) { 16 | println(x) 17 | } else { 18 | // The opposite condition: x <= y 19 | println(y) 20 | } 21 | ``` 22 | 23 | For the `else` branch, the reverse of the original condition is used: for example, 24 | for `x > y`, the opposite condition is `x <= y`. 25 | -------------------------------------------------------------------------------- /WarmUp/ifExpression/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/ifExpression/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Conditional Operator as Expression 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/ifExpression/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1691431341 2 | -------------------------------------------------------------------------------- /WarmUp/isCompleteFunction/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/isCompleteFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - isComplete Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | - name: test/Tests.kt 9 | visible: false 10 | - name: test/MainClass.kt 11 | visible: false 12 | - name: test/Methods.kt 13 | visible: false 14 | -------------------------------------------------------------------------------- /WarmUp/isCompleteFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1170272381 2 | -------------------------------------------------------------------------------- /WarmUp/isCompleteFunction/task.md: -------------------------------------------------------------------------------- 1 | In this task we will create a function to check if the game is complete. 2 | 3 | ### Task 4 | 5 | - Define a function `isComplete`, which accepts `secret` and `guess` and checks if the game is over. 6 | For now, let it always return `true`. We will implement the function logic later. 7 | 8 |
9 | 10 | The signature of the function is: 11 | ```kotlin 12 | fun isComplete(secret: String, guess: String): Boolean 13 | ``` 14 |
15 | -------------------------------------------------------------------------------- /WarmUp/isCompleteFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | getGameRulesMethod, 7 | generateSecretMethod, 8 | countPartialMatchesMethod, 9 | countExactMatchesMethod, 10 | isCompleteMethod 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /WarmUp/isLostFunction/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/isLostFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - isLost Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/Tests.kt 13 | visible: false 14 | -------------------------------------------------------------------------------- /WarmUp/isLostFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 168358096 2 | -------------------------------------------------------------------------------- /WarmUp/isLostFunction/task.md: -------------------------------------------------------------------------------- 1 | Let's implement the second function. 2 | 3 | ### Task 4 | 5 | Add a function `isLost`, which accepts three arguments: `complete`, `attempts`, and `maxAttemptsCount` 6 | and returns `true` only if the user **did not** guess the word (the `complete` variable stores `false`) **and** spent _more_ than `maxAttemptsCount` attempts. 7 | 8 |
9 | 10 | The signature of the function is: 11 | ```kotlin 12 | fun isLost(complete: Boolean, attempts: Int, maxAttemptsCount: Int): Boolean 13 | ``` 14 |
15 | -------------------------------------------------------------------------------- /WarmUp/isLostFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | generateSecretMethod, 10 | getGameRulesMethod, 11 | countAllMatches, 12 | printRoundResultsMethod, 13 | isWinMethod, 14 | isLostMethod, 15 | playGameMethod 16 | ), 17 | ) 18 | -------------------------------------------------------------------------------- /WarmUp/isWinFunction/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/isWinFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - isWon Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/Tests.kt 13 | visible: false 14 | -------------------------------------------------------------------------------- /WarmUp/isWinFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1496648535 2 | -------------------------------------------------------------------------------- /WarmUp/isWinFunction/task.md: -------------------------------------------------------------------------------- 1 | It's time to implement functions that indicate if the user win or lose. Let's start from the first one. 2 | 3 | ### Task 4 | 5 | Add a function `isWon`, which accepts three arguments: `complete`, `attempts`, and `maxAttemptsCount` 6 | and returns `true` only if the user guessed the word (the `complete` variable stores `true`) 7 | **and** spent _not more_ than `maxAttemptsCount` attempts. 8 | 9 |
10 | 11 | The signature of the function is: 12 | ```kotlin 13 | fun isWon(complete: Boolean, attempts: Int, maxAttemptsCount: Int): Boolean 14 | ``` 15 |
16 | -------------------------------------------------------------------------------- /WarmUp/isWinFunction/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | generateSecretMethod, 10 | getGameRulesMethod, 11 | countAllMatches, 12 | printRoundResultsMethod, 13 | isWinMethod, 14 | playGameMethod 15 | ), 16 | ) 17 | -------------------------------------------------------------------------------- /WarmUp/lambdaFunctions/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/lambdaFunctions/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Lambda Expressions 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/lambdaFunctions/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1847786086 2 | -------------------------------------------------------------------------------- /WarmUp/lesson-info.yaml: -------------------------------------------------------------------------------- 1 | type: framework 2 | custom_name: Warm up 3 | content: 4 | - Introduction 5 | - typesOfVariablesTheory 6 | - TypesOfVariables 7 | - customFunctionsTheory 8 | - customFunctionsTheoryPartTwo 9 | - todoFunction 10 | - CustomFunctions 11 | - isCompleteFunction 12 | - loopsTheory 13 | - mutableVariable 14 | - Loops 15 | - playGameMain 16 | - ifDefinition 17 | - ifExpression 18 | - If 19 | - listTheory 20 | - lambdaFunctions 21 | - Collections 22 | - CollectionsPartTwo 23 | - countPartialMatches 24 | - printRoundResults 25 | - compositeIf 26 | - isWinFunction 27 | - isLostFunction 28 | - compositeOperators 29 | - breakExpression 30 | - CompleteTheProject 31 | is_template_based: false 32 | -------------------------------------------------------------------------------- /WarmUp/lesson-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1584793307 2 | -------------------------------------------------------------------------------- /WarmUp/listTheory/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/listTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Basics About Collections 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/listTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1152431309 2 | -------------------------------------------------------------------------------- /WarmUp/loopsTheory/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/loopsTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Loops 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/loopsTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 554684746 2 | -------------------------------------------------------------------------------- /WarmUp/mutableVariable/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/mutableVariable/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Mutable Variable 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/mutableVariable/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 42223778 2 | -------------------------------------------------------------------------------- /WarmUp/mutableVariable/task.md: -------------------------------------------------------------------------------- 1 | Loops often require changing the value of a variable. 2 | To do that, you can use the [`var`](https://kotlinlang.org/docs/basic-syntax.html#variables) variable: 3 | ```kotlin 4 | var y = 5 5 | do { 6 | println(y) 7 | y += 2 8 | } while(y < 10) 9 | ``` 10 | This code initializes the variable `y` with the value `5` and next, changes the variable in the loop. 11 | The loop will be executed in 3 steps: 12 | 1) y = 5. println(y). y = 7. 13 | 2) because y < 10, println(y), y = 9. 14 | 3) because y < 10, println(y), y = 11. 15 | 4) because y > 10, stop the loop. 16 | In the end, the following numbers: 5, 7, and 9 will be printed in the console. 17 | -------------------------------------------------------------------------------- /WarmUp/playGameMain/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/playGameMain/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - Run Game 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/Tests.kt 13 | visible: false 14 | -------------------------------------------------------------------------------- /WarmUp/playGameMain/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 2030724675 2 | -------------------------------------------------------------------------------- /WarmUp/playGameMain/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | generateSecretMethod, 8 | playGameMethod, 9 | getGameRulesMethod, 10 | countPartialMatchesMethod, 11 | countExactMatchesMethod, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /WarmUp/printRoundResults/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/printRoundResults/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: edu 2 | custom_name: Mastermind - printRoundResults Function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 5 | visible: false 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 7 | visible: true 8 | - name: test/MainClass.kt 9 | visible: false 10 | - name: test/Methods.kt 11 | visible: false 12 | - name: test/Tests.kt 13 | visible: false 14 | -------------------------------------------------------------------------------- /WarmUp/printRoundResults/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1642783440 2 | -------------------------------------------------------------------------------- /WarmUp/printRoundResults/test/MainClass.kt: -------------------------------------------------------------------------------- 1 | import org.jetbrains.academy.test.system.core.models.classes.TestClass 2 | 3 | internal val mainClass = TestClass( 4 | classPackage = "jetbrains.kotlin.course.warmup", 5 | customMethods = listOf( 6 | isCompleteMethod, 7 | countExactMatchesMethod, 8 | countPartialMatchesMethod, 9 | generateSecretMethod, 10 | getGameRulesMethod, 11 | countAllMatches, 12 | printRoundResultsMethod, 13 | playGameMethod 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /WarmUp/todoFunction/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/todoFunction/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - TODO function 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/todoFunction/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 187571066 2 | -------------------------------------------------------------------------------- /WarmUp/todoFunction/task.md: -------------------------------------------------------------------------------- 1 | Kotlin has a special [`TODO()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-t-o-d-o.html) function, 2 | which can be used as a temporary solution instead of implementing the function body: 3 | ```kotlin 4 | fun myName(intVariable: Int): Int = TODO("Not implemented yet") 5 | ``` 6 | 7 | It can be useful when you need to define only _signatures_ of functions to build the main logic of the program, 8 | but then implement them step-by-step. 9 | 10 | If you use the `TODO` function, you **must** put the return type for this function directly: 11 | 12 | ```kotlin 13 | fun correctFunction(intVariable: Int): Int = TODO("Not implemented yet") // CORRECT 14 | fun incorrectFunction(intVariable: Int) = TODO("Not implemented yet") // INCORRECT 15 | ``` 16 | -------------------------------------------------------------------------------- /WarmUp/typesOfVariablesTheory/src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.warmup 2 | 3 | fun safeReadLine() = readlnOrNull() ?: error("Your input is incorrect, sorry") 4 | 5 | val newLineSymbol: String = System.lineSeparator() 6 | -------------------------------------------------------------------------------- /WarmUp/typesOfVariablesTheory/task-info.yaml: -------------------------------------------------------------------------------- 1 | type: theory 2 | custom_name: Mastermind - Types of Variables 3 | files: 4 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Main.kt 5 | visible: true 6 | - name: src/main/kotlin/jetbrains/kotlin/course/warmup/Util.kt 7 | visible: false 8 | -------------------------------------------------------------------------------- /WarmUp/typesOfVariablesTheory/task-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 1190201896 2 | -------------------------------------------------------------------------------- /course-remote-info.yaml: -------------------------------------------------------------------------------- 1 | id: 21067 2 | update_date: "Wed, 15 Feb 2023 13:19:18 UTC" 3 | course_version: 20 4 | generated_edu_id: "Kotlin Onboarding: Introduction_JetBrains_kotlin" 5 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/configs/ChooseFilter.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 49 3 | rows: 7 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'choose_filter_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'choose_filter' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: b 24 | 25 | - expect: \n 26 | - write: borderss 27 | 28 | - expect: \n 29 | - write: borders 30 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/configs/ChoosePicture.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 66 3 | rows: 7 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'choose_picture_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'choose_picture' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: s 24 | 25 | - expect: \n 26 | - write: simba 27 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/configs/GetPicture.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 70 3 | rows: 8 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'get_picture_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'get_picture' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: n 24 | 25 | - expect: \n 26 | - write: "no" 27 | 28 | - expect: \n 29 | - write: ^_^ 30 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/configs/Photoshop.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 70 3 | rows: 36 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'game_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'game' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: "yes" 24 | 25 | - expect: \n 26 | - write: simba 27 | 28 | - expect: \n 29 | - write: squared 30 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/configs/TrimmedPicture.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 22 3 | rows: 20 4 | 5 | gif_config: 6 | common: 7 | font_size: 32 8 | font_family: JetBrains Mono 9 | 10 | gifs: 11 | - name: 'trimmed_picture_dark' 12 | theme: 'jetbrains_dark' 13 | 14 | - name: 'trimmed_picture' 15 | theme: 'jetbrains_light' 16 | 17 | scenario: 18 | - expect: \n 19 | 20 | - wait: 500 21 | - ctrl: m 22 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/runners/ChooseFilter.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.almost.done.runners 2 | 3 | import jetbrains.kotlin.course.almost.done.chooseFilter 4 | 5 | fun main() { 6 | chooseFilter() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/runners/ChoosePicture.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.almost.done.runners 2 | 3 | import jetbrains.kotlin.course.almost.done.choosePicture 4 | 5 | fun main() { 6 | choosePicture() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/runners/GetPicture.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.almost.done.runners 2 | 3 | import jetbrains.kotlin.course.almost.done.getPicture 4 | 5 | fun main() { 6 | getPicture() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/runners/Photoshop.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.almost.done.runners 2 | 3 | import jetbrains.kotlin.course.almost.done.photoshop 4 | 5 | fun main() { 6 | photoshop() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/almost/done/runners/TrimmedPicture.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.almost.done.runners 2 | 3 | import jetbrains.kotlin.course.almost.done.simba 4 | import jetbrains.kotlin.course.almost.done.trimPicture 5 | 6 | fun main() { 7 | println("// The original image:") 8 | println(simba) 9 | readln() 10 | println("// The final image:") 11 | println(trimPicture(simba)) 12 | } 13 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/chat/configs/Game.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 78 3 | rows: 8 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 35 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'game_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'game' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: Anastasiia 24 | 25 | - expect: \n 26 | - write: 26 27 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/chat/runners/Game.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.chat.runners 2 | 3 | import jetbrains.kotlin.course.chat.main 4 | 5 | fun main() { 6 | main() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/first/date/configs/Game.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 48 3 | rows: 16 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 35 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'game_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'game' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: New drink at Starbucks 24 | 25 | - expect: \n 26 | - write: Was at home and was thinking about future 27 | 28 | - expect: \n 29 | - write: To quickly run away from enemies 30 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/first/date/configs/UserInput.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 48 3 | rows: 9 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 35 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'user_input_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'user_input' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: New drink at Starbucks 24 | 25 | - expect: \n 26 | - write: Was at home and was thinking about future 27 | 28 | - expect: \n 29 | - write: To quickly run away from enemies 30 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/first/date/runners/Game.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.first.date.runners 2 | 3 | import jetbrains.kotlin.course.first.date.main 4 | 5 | fun main() { 6 | main() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/first/date/runners/UserInput.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.first.date.runners 2 | 3 | fun main() { 4 | println("Hello! I will ask you several questions.\n" + 5 | "Please answer all of them and be honest with me!") 6 | println("What is TROTEN?") 7 | readlnOrNull() 8 | println("How did you spend your graduation?") 9 | readlnOrNull() 10 | println("Why does a spider need eight legs?") 11 | readlnOrNull() 12 | } 13 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/hangman/configs/Game.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 83 3 | rows: 36 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'game_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'game' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: 1 24 | 25 | - expect: \n 26 | - write: AB 27 | 28 | - expect: \n 29 | - write: A 30 | 31 | - expect: \n 32 | - write: E 33 | 34 | - expect: \n 35 | - write: T 36 | 37 | - expect: \n 38 | - write: R 39 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/hangman/runners/Game.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.hangman.runners 2 | 3 | import jetbrains.kotlin.course.hangman.getGameRules 4 | import jetbrains.kotlin.course.hangman.maxAttemptsCount 5 | import jetbrains.kotlin.course.hangman.playGame 6 | import jetbrains.kotlin.course.hangman.wordLength 7 | 8 | fun main() { 9 | println(getGameRules(wordLength, maxAttemptsCount)) 10 | playGame("TREE", maxAttemptsCount) 11 | } 12 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/last/push/configs/App.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 81 3 | rows: 35 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'app_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'app' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: y 24 | 25 | - expect: \n 26 | - write: "yes" 27 | 28 | - expect: \n 29 | - write: r 30 | 31 | - expect: \n 32 | - write: rhombus 33 | 34 | - expect: \n 35 | - write: canvasGaps 36 | 37 | - expect: \n 38 | - write: 12 39 | 40 | - expect: \n 41 | - write: 3 42 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/last/push/runners/App.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.last.push.runners 2 | 3 | import jetbrains.kotlin.course.last.push.main 4 | 5 | fun main() { 6 | main() 7 | } 8 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/warmup/configs/Game.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 96 3 | rows: 30 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'game_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'game' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: BB 24 | 25 | - expect: \n 26 | - write: BBYB 27 | 28 | - expect: \n 29 | - write: BBBB 30 | 31 | - expect: \n 32 | - write: BBDH 33 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/warmup/configs/SafeUserInput.yaml: -------------------------------------------------------------------------------- 1 | terminal_config: 2 | cols: 77 3 | rows: 12 4 | 5 | interaction_config: 6 | action_delay: 200 7 | keystroke_delay: 75 8 | 9 | gif_config: 10 | common: 11 | font_size: 32 12 | font_family: JetBrains Mono 13 | 14 | gifs: 15 | - name: 'safe_user_input_dark' 16 | theme: 'jetbrains_dark' 17 | 18 | - name: 'safe_user_input' 19 | theme: 'jetbrains_light' 20 | 21 | scenario: 22 | - expect: \n 23 | - write: BB 24 | 25 | - expect: \n 26 | - write: BBYB 27 | 28 | - expect: \n 29 | - write: BBBB 30 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/warmup/runners/Game.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.warmup.runners 2 | 3 | import jetbrains.kotlin.course.mastermind.advanced.* 4 | 5 | fun main() { 6 | val wordLength = 4 7 | val maxAttemptsCount = 3 8 | val secretExample = "ACEB" 9 | val alphabet = "ABCDEFGH" 10 | println(getGameRules(wordLength, maxAttemptsCount, secretExample).replace(". ", ".$newLineSymbol")) 11 | playGame("BBDH", wordLength, maxAttemptsCount, alphabet) 12 | } 13 | -------------------------------------------------------------------------------- /gifs/src/main/kotlin/jetbrains/kotlin/course/gifs/warmup/runners/SafeUserInput.kt: -------------------------------------------------------------------------------- 1 | package jetbrains.kotlin.course.gifs.warmup.runners 2 | 3 | import jetbrains.kotlin.course.mastermind.advanced.safeUserInput 4 | 5 | fun main() { 6 | safeUserInput(4, "ABCDEFGH") 7 | } 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /utils/build.gradle.kts: -------------------------------------------------------------------------------- 1 | group = rootProject.group 2 | version = rootProject.version 3 | -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/choose_filter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/choose_filter.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/choose_filter_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/choose_filter_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/choose_picture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/choose_picture.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/choose_picture_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/choose_picture_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/borders/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/borders/android.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/borders/android_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/borders/android_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/borders/monkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/borders/monkey.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/borders/monkey_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/borders/monkey_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/squared/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/squared/android.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/squared/android_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/squared/android_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/squared/monkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/squared/monkey.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/examples/squared/monkey_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/examples/squared/monkey_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/game.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/game.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/game.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/game_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/game_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/get_picture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/get_picture.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/get_picture_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/get_picture_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/trimmed_picture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/trimmed_picture.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/trimmed_picture_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/trimmed_picture_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/when_hint_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/when_hint_1.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/when_hint_1_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/when_hint_1_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/when_hint_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/when_hint_2.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/almost.done/when_hint_2_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/almost.done/when_hint_2_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/chat/game.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/chat/game.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/chat/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/chat/game.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/chat/game_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/chat/game_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/entry_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/entry_point.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/entry_point_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/entry_point_dark.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/game.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/game.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/game.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/game_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/game_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/run_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/run_example.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/run_example_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/run_example_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/user_input.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/user_input.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/first.date/user_input_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/first.date/user_input_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/hangman/game.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/hangman/game.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/hangman/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/hangman/game.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/hangman/game_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/hangman/game_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/last.push/app.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/last.push/app.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/last.push/app_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/last.push/app_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/last.push/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/last.push/game.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/warmup/game.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/warmup/game.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/warmup/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/warmup/game.png -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/warmup/game_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/warmup/game_dark.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/warmup/safe_user_input.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/warmup/safe_user_input.gif -------------------------------------------------------------------------------- /utils/src/main/resources/images/part1/warmup/safe_user_input_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jetbrains-academy/kotlin-onboarding-introduction/e5c7b17e422c63f580545cbf3701bc0dba921f3b/utils/src/main/resources/images/part1/warmup/safe_user_input_dark.gif --------------------------------------------------------------------------------