Skip to content

zadykian/hyperskill-projects-kotlin-core

Repository files navigation

Kotlin Core

logo

This repository houses several projects developed during Kotlin Core course provided by JetBrains Academy

The projects are developed using Kotlin 2.0 and several additional packages:

  1. kotlin-reflect for some metadata manipulation
  2. arrow in combination with context parameters
  3. kotlinpoet to generate test case data in indigo-card-game
  4. junit-jupiter and assertk for unit testing

Projects

All these projects are essentially console applications which communicate with the user in a request-response manner

List is ordered by project completion date

A simple app which parsers and converts different types of unit (length, weight and temperature). The core conversion logic is located in Unit.kt

An arithmetic calculator which supports main operators [+, -, *, /, ^], calculations in parentheses and variable assignment.

Calculation is based on the Polish Postfix Notation and implemented in Calculator.kt

Expression tokenization and parsing is located in package calculator.parser

A text-only card game with several neat features:

  • [2-8] players supported;
  • Two kinds of Player: User and Computer;
  • Each game can be played by any number of users/computers (as long as the total number of players is correct);
  • Fully immutable state with event-based logic: GameEvent.kt

CLI tool which provides several commands to observe git repository content:

  • cat-file - display git object's (commit, tree or blob) content with the specified hash
  • list-branches - list all repository branches and specify which is the current one
  • log - show a full commit history for a specified branch
  • commit-tree - show a full git file system tree of a commit with the specified hash

This one is my favorite because it required a lot of reverse engineering, and it helped me to get a better understanding of git internal structure

A phone book application with several contact types supported.

Implementation is heavily based on Arrow library - Either<E, R>, Ior<E, R>, Raise<Error> types and opted-in Kotlin context parameters.

Also in this project I used Either-returning constructor technique (like here), which I learned about from a great book by Alejandro Serrano Mena: FP Ideas for the Curious Kotliner