Kotlin Onboarding: Introduction
This course is designed for novices in Kotlin and focuses on the basic concepts of the Kotlin language. Each lesson of the course is built in the form of a project: step by step, by completing different small tasks, you will get a finished small project in the end. At the end of each lesson, an additional similar project will be offered: it includes all the lesson topics but does not contain the theory part.
Note, this course does not provide a detailed explanation of the basic concepts, like variables: it just shows how to use them in Kotlin and can briefly remind you the definitions.
All topics will be accompanied by links to the official Kotlin documentation, which you can read later. After this course, you will be ready to write basic console applications in the Kotlin-like style.
What You’ll Do And Learn
Screenshots
Rating & Reviews
Getting Started
To start the course, you first need to download IntelliJ IDEA and enable its educational functionality:
- Download the installer from the IntelliJ IDEA for Education page.
- Run the installer and follow the wizard steps.
- Once IntelliJ IDEA is up and running, switch to the Learn tab on the Welcome screen.
- Click Enable Access under the “Learn to program” widget.
Once it’s enabled, click the Get Started button and select Kotlin Onboarding: Introduction from the list. You can also access this course by going to File | Learn and Teach | Browse Courses.
For more information, see the Learner Start Guide.
Kevin
09.06.2024The lessons don't accept correct answers.
for the Mastermind lesson, this is my code. It runs correctly, but the tutorial declines it, and says it fails, which means im unable to move forward in the lesson.
package jetbrains.kotlin.course.warmup
// You will use this function later fun getGameRules(wordLength: Int, maxAttemptsCount: Int, secretExample: String): String = "Welcome to the game! $newLineSymbol" + newLineSymbol + "Two people play this game: one chooses a word (a sequence of letters), " + "the other guesses it. In this version, the computer chooses the word: " + "a sequence of $wordLength letters (for example, $secretExample). " + "The user has several attempts to guess it (the max number is $maxAttemptsCount). " + "For each attempt, the number of complete matches (letter and position) " + "and partial matches (letter only) is reported. $newLineSymbol" + newLineSymbol + "For example, with $secretExample as the hidden word, the BCDF guess will " + "give 1 full match (C) and 1 partial match (B)."
fun generateSecret(): String = "ABCD"
fun countPartialMatches(secret: String, guess: String): Int{ return 0 }
fun countExactMatches(secret: String, guess: String): Int = TODO()
fun isComplete(secret: String, guess: String): Boolean = true
fun playGame(secret: String, wordLength: Int, maxAttemptsCount: Int){ do{ println("Please input your guess. It should be of length $wordLength") val guess = safeReadLine() }while(!isComplete(secret, guess)) }
fun main() { val wordLength = 4 val maxAttemptsCount = 3 val secretExample = "ACEB" println(getGameRules(wordLength,maxAttemptsCount,secretExample)) playGame(generateSecret(), wordLength, maxAttemptsCount) }