Skip to content

Guess the secret number

Now the secret number is configurable via SECRET_NUMBER environment variable!

How to compile

bash
kotlinc src/**/*.kt -d build

How to run

bash
SECRET_NUMBER=11 kotlin -cp build project004.GuessKt 11

Noteworthy

  • System.getenv() is a java function being consumed by kotlin code
  • If environment variable is not set an exception is thrown.

See docs for further details.