lidonis / leap-year-kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leap year kata in Kotlin

Goal

This repository should be an example of TDD with each commit representing one step in the process. It will be written using the Kotlin language and using Kotest as test framework

Rules

Implement a function that checks if a year is a leap year.

The function should return true if a year is a leap year, and false if it is not.

Note
Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400

Examples

  • 2021 is not a leap year (not divisible by 4)

  • 2020 is a leap year (divisible by 4)

  • 2000 is a leap year (divisible by 400)

  • 1900 is not a leap year (divisible by 4, divisible by 100, NOT divisible by 400)

About


Languages

Language:Kotlin 100.0%