class RotationalCipher(val cipher: Int) {
    fun encode(inpString: String): String {
        return inpString.map { it.encode(cipher) }.joinToString(separator = "")
    }
}

fun Char.encode(amount: Int): Char{
    if (this.isUpperCase()){
        val temp = this + amount
        if (!temp.isUpperCase()){
            return temp - 26
        }
        else return temp
    }
    else if (this.isLowerCase()){
        val temp = this + amount
        if (!temp.isLowerCase()){
            return temp - 26
        }
        else return temp
    }
    else {return this}
}