jetbrains-academy / kotlin-onboarding-introduction

The introduction to the Kotlin Onboarding course
MIT License
9 stars 2 forks source link

Execution failed. Introduction/Warm up/Custom functions #155

Closed edutools-service closed 4 months ago

edutools-service commented 1 year ago

As all inquirers will, I thought I had created the functions required. Even added printlns of the return values of them thinking that might be the offering the test wanted. Nope.
Run window doesn't appear, from which I deduce I have done something remarkable. Only get "5 Tests failed 0 tests passed" bubbles near check button, then finally Execution Failed after those bubbles go away.

Run does work. I did implement two of the functions like this: fun countPartialMatches(secret: String, guess: String): Int = TODO("Not implemented yet.") fun countExactMatches(secret: String, guess: String): Int = TODO("Not implemented yet.")

which yielded the amusing below in the run window.

Welcome to the game! 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 4 letters (for example, ACEB). The user has several attempts to guess it (the max number is 3). For each attempt, the number of complete matches (letter and position) and partial matches (letter only) is reported. For example, with ACEB as the hidden word, the BCDF guess will give 1 full match (C) and 1 partial match (B). ACEB Exception in thread "main" kotlin.NotImplementedError: An operation is not implemented: Not implemented yet. at MainKt.main$countPartialMatches(Main.kt:37) at MainKt.main(Main.kt:44) at MainKt.main(Main.kt)

Process finished with exit code 1

Daoortor commented 4 months ago

You seem to have edited the main() function and call functions that are not implemented (although I cannot be sure since I haven't seen your code. Please include your code in your issues from now on). In this task, it's not necessary to edit main. I will add better NotImplementedError handling in tests to produce more readable errors and reduce this kind of issues in the future.