This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| repositories { | |
| google() | |
| jcenter() | |
| mavenCentral() | |
| maven { url "https://jitpack.io" } | |
| } | |
| import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask | |
| apply plugin: 'com.android.library' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.kithub.core.viewmodel.repodetail | |
| import com.kithub.core.data.GithubApi | |
| import com.kithub.core.data.UserPreference | |
| import com.kithub.core.viewmodel.KViewModel | |
| import kotlinx.coroutines.launch | |
| data class RepoDetailViewState( | |
| val loading: Boolean = true, | |
| val name: String = "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.bigbear.judrummer | |
| import kotlinx.coroutines.* | |
| import kotlinx.coroutines.channels.* | |
| fun CoroutineScope.hangman(secretWord: String, letterStream: ReceiveChannel<Char>) = produce { | |
| var result = Result( | |
| secretWordLength = secretWord.length, | |
| knownSecretWord = List(secretWord.length) { '_' }.joinToString("") | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun hangman(secretWord: String, letters: List<Char>) = (secretWord.toList() - letters).isEmpty() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun hangman(secretWord: String, letters: List<Char>): Boolean { | |
| val remaingChars = secretWord.toCharArray().toMutableList() | |
| var score = 7 | |
| var i = 0 | |
| while (remaingChars.size > 0 && i < letters.size && score > 0) { | |
| if (!remaingChars.remove(letters[i])) score-- | |
| i++ | |
| } | |
| return score > 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.judrummer.codebattle | |
| import java.util.* | |
| /** | |
| * Created by judrummer on 6/17/2017. | |
| */ | |
| fun main(arg: Array<String>) { | |
| Scanner(System.`in`).use { input -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inline fun jxAdapter(builder: __JxAdapterBuilder.() -> Unit): JxAdapter { | |
| val jxBuilder = __JxAdapterBuilder() | |
| jxBuilder.builder() | |
| return jxBuilder.build() | |
| } | |
| class __JxAdapterBuilder { | |
| val __jxHolderList = mutableListOf<JxViewHolder<*>>() | |
| var __jxDiffUtil: JxDiffUtil? = null |