package iii_conventions

import util.TODO
import iii_conventions.TimeInterval.*

fun todoTask29(): Nothing = TODO(
    """
        Task 29.
        Implement a kind of date arithmetic. Support adding years, weeks and days to a date.
        Use classes 'MyDate' and 'TimeInterval'.
        Use a utility function 'MyDate.addTimeIntervals'.
        Uncomment the commented line and make it compile.

        (1). Add an extension function 'plus()' to MyDate, taking a TimeInterval as an argument.
        (2). Support adding several time intervals to a date. Add an extra class.
        If you have any problems, see the iii_conventions/_29_Tips.kt file.
    """,
    references = { date: MyDate, timeInterval: TimeInterval ->
        date.addTimeIntervals(timeInterval, 1)
    })

fun task29_1(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR + WEEK
}

fun task29_2(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR * 2 + WEEK * 3 + DAY * 5
}


package iii_conventions

import util.TODO
import iii_conventions.TimeInterval.*

fun todoTask29(): Nothing = TODO(
    """
        Task 29.
        Implement a kind of date arithmetic. Support adding years, weeks and days to a date.
        Use classes 'MyDate' and 'TimeInterval'.
        Use the provided utility function 'MyDate.addTimeIntervals'.
        Uncomment the commented line and make it compile.

        (1). Add an extension function 'plus()' to MyDate, taking a TimeInterval as an argument.
        (2). Support adding several time intervals to a date. Add an extra class.
        If you have any problems, see the iii_conventions/_29_Tips.kt file.
    """,
    references = { date: MyDate, timeInterval: TimeInterval ->
        date.addTimeIntervals(timeInterval, 1)
    })

fun task29_1(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR + WEEK
}

fun task29_2(today: MyDate): MyDate {
    todoTask29()
//    return today + YEAR * 2 + WEEK * 3 + DAY * 5
}


Clarify instructions for exercise 29 (operators overloading)
Clarify instructions for exercise 29 (operators overloading)

enchf/kotlin-koans,trmollet/tuto_kotlin,Carighan/kotlin-koans,Riccorl/kotlin-koans,hughandrewarch/kotlin-koans,zyallday/kotlin-koans,Kotlin/kotlin-koans,hughandrewarch/kotlin-koans,Kotlin/kotlin-koans,enchf/kotlin-koans,Carighan/kotlin-koans,TheCoinTosser/Kotlin-Koans---Solutions,zyallday/kotlin-koans,Riccorl/kotlin-koans,JetBrains/workshop-jb,trmollet/tuto_kotlin,JetBrains/workshop-jb,TheCoinTosser/Kotlin-Koans---Solutions