Skip to content

Commit

Permalink
Merge pull request #3 from Naaate/master
Browse files Browse the repository at this point in the history
Emjional Abuse
  • Loading branch information
fractalwrench committed Jul 30, 2018
2 parents ccbb8d0 + 7251dc6 commit c73f9a8
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions src/main/kotlin/com.fractalwrench.iokk/n01/n01HelloWorld_Naaate.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.fractalwrench.iokk.n01

//Do a little pre obfuscation
typealias `๐Ÿง ` = Any
typealias `๐Ÿคฃ` = Int
typealias `๐Ÿค”` = IntRange
typealias `๐Ÿ` = String
typealias `๐Ÿคฏ` = Unit
typealias `โœ…` = () -> `๐Ÿ`

/**
* Abuse of infix functions, type aliases, and emoji lead to this awesomeness
*/
fun ch1Solution_Naaate() {
`๐Ÿ–•`().`๐Ÿ‘Œ`()
}


class `๐Ÿ–•`(){
val `๐Ÿ˜˜` = 32..114 `๐Ÿคฎ` { it - 32 }

fun `๐Ÿ‘Œ`() =
((40 `๐Ÿ˜‚` 69).`๐Ÿ˜‚`(76,2) `๐Ÿ˜‚` 79 `๐Ÿ˜‚` 12 `๐Ÿ˜‚` 0 `๐Ÿ˜‚` 55 `๐Ÿ˜‚` 79 `๐Ÿ˜‚` 82 `๐Ÿ˜‚` 76 `๐Ÿ˜‚` 68 `๐Ÿ˜‚` 1).`๐Ÿ‘™` `๐Ÿ’ฏ` ::`๐Ÿ–จ๏ธ`

/**
* takes an `๐Ÿคฃ` and returns a `โœ…` that looks up the value for each `๐Ÿคฃ`, converts them to chars and returns them as
* `๐Ÿ`
*
* Once again,
*
* takes an Int and returns a () -> String that looks up the value for each Int, converts them to chars and returns
* them as String
*/
private infix fun `๐Ÿคฃ`.`๐Ÿ˜‚`( `๐Ÿ˜`: `๐Ÿคฃ`): `โœ…` = {
(::`๐Ÿ…` `๐Ÿ’ฉ` `๐Ÿ˜˜`[this]!!) +
(::`๐Ÿ…` `๐Ÿ’ฉ` `๐Ÿ˜˜`[`๐Ÿ˜`]!!)
}

/**
* returns `โœ…` that calls receiving `โœ…` before looking up, converting to char, and appending`๐Ÿ˜`
*
* returns () -> String that calls receiving () -> String before looking up, converting to char, and appending the
* Int parameter
*/
private infix fun `โœ…`.`๐Ÿ˜‚`( `๐Ÿ˜`: `๐Ÿคฃ`): `โœ…` = {
this.`๐Ÿ‘™` + (::`๐Ÿ…` `๐Ÿ’ฉ` `๐Ÿ˜˜`[`๐Ÿ˜`]!!)
}

/**
* calls ๐Ÿ‘† that one `๐Ÿ˜™` number of times
*/
private fun `โœ…`.`๐Ÿ˜‚`( `๐Ÿ˜`: `๐Ÿคฃ`, `๐Ÿ˜™`: `๐Ÿคฃ`): `โœ…` {
var `๐Ÿ` = this
var `๐ŸŒ` = `๐Ÿ˜™`
while(`๐ŸŒ` > 0){
`๐ŸŒ` --
`๐Ÿ` = `๐Ÿ` `๐Ÿ˜‚` `๐Ÿ˜`
}

return`๐Ÿ`
}

/**
* Int.toChar().toString()
*/
private infix fun `๐Ÿ…`(`๐Ÿ˜`: `๐Ÿคฃ`) = `๐Ÿ˜`::toChar.`๐Ÿ‘™`::toString.`๐Ÿ‘™`

/**
* IntRange.associateBy
*/
private infix fun `๐Ÿค”`.`๐Ÿคฎ`(`๐Ÿง`: (`๐Ÿคฃ`) -> `๐Ÿคฃ`) = associateBy(`๐Ÿง`)

/**
* String.let
*/
private infix fun `๐Ÿ`.`๐Ÿ’ฏ`(`๐Ÿง`: (`๐Ÿ`) -> `๐Ÿคฏ`) = let(`๐Ÿง`)

/**
* println
*/
private infix fun `๐Ÿ–จ๏ธ` (`๐Ÿง`: `๐Ÿ`): `๐Ÿคฏ` = println(`๐Ÿง`)

/**
* infix fun <T: Any, U: Any > ((T) -> u).`๐Ÿ’ฉ`(param: T) = this(param)
*
* because who directly calls things these days?
*/
private infix fun <`๐Ÿ™`: `๐Ÿง `, `๐Ÿ‘ฝ`: `๐Ÿง ` > ((`๐Ÿ™`) -> `๐Ÿ‘ฝ`).`๐Ÿ’ฉ`(`๐Ÿค‘`: `๐Ÿ™`) = this(`๐Ÿค‘`)

/**
* val <T: Any> (() -> T).`๐Ÿ‘™` : T
*
* makes functions with no parameters callable by accessing .`๐Ÿ‘™`
*
* because empty brackets are boring
*/
val <`๐Ÿ™`: `๐Ÿง `> (() -> `๐Ÿ™`).`๐Ÿ‘™` : `๐Ÿ™`
get() = this()

}

0 comments on commit c73f9a8

Please sign in to comment.