diff --git a/kotlin/resistor-color/.gradle/6.0.1/executionHistory/executionHistory.bin b/kotlin/resistor-color/.gradle/6.0.1/executionHistory/executionHistory.bin new file mode 100644 index 0000000..08b40d9 Binary files /dev/null and b/kotlin/resistor-color/.gradle/6.0.1/executionHistory/executionHistory.bin differ diff --git a/kotlin/resistor-color/.gradle/6.0.1/executionHistory/executionHistory.lock b/kotlin/resistor-color/.gradle/6.0.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..a99e164 Binary files /dev/null and b/kotlin/resistor-color/.gradle/6.0.1/executionHistory/executionHistory.lock differ diff --git a/kotlin/resistor-color/.gradle/6.0.1/fileChanges/last-build.bin b/kotlin/resistor-color/.gradle/6.0.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/kotlin/resistor-color/.gradle/6.0.1/fileChanges/last-build.bin differ diff --git a/kotlin/resistor-color/.gradle/6.0.1/fileContent/fileContent.lock b/kotlin/resistor-color/.gradle/6.0.1/fileContent/fileContent.lock new file mode 100644 index 0000000..4e008a3 Binary files /dev/null and b/kotlin/resistor-color/.gradle/6.0.1/fileContent/fileContent.lock differ diff --git a/kotlin/resistor-color/.gradle/6.0.1/fileHashes/fileHashes.bin b/kotlin/resistor-color/.gradle/6.0.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..07a95a3 Binary files /dev/null and b/kotlin/resistor-color/.gradle/6.0.1/fileHashes/fileHashes.bin differ diff --git a/kotlin/resistor-color/.gradle/6.0.1/fileHashes/fileHashes.lock b/kotlin/resistor-color/.gradle/6.0.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..bf7a624 Binary files /dev/null and b/kotlin/resistor-color/.gradle/6.0.1/fileHashes/fileHashes.lock differ diff --git a/kotlin/resistor-color/.gradle/6.0.1/gc.properties b/kotlin/resistor-color/.gradle/6.0.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/resistor-color/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/kotlin/resistor-color/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..02fbf80 Binary files /dev/null and b/kotlin/resistor-color/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/kotlin/resistor-color/.gradle/buildOutputCleanup/cache.properties b/kotlin/resistor-color/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..d8eae64 --- /dev/null +++ b/kotlin/resistor-color/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Mar 05 17:39:23 EST 2020 +gradle.version=6.0.1 diff --git a/kotlin/resistor-color/.gradle/buildOutputCleanup/outputFiles.bin b/kotlin/resistor-color/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..4223993 Binary files /dev/null and b/kotlin/resistor-color/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/kotlin/resistor-color/.gradle/vcs-1/gc.properties b/kotlin/resistor-color/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/resistor-color/.idea/.gitignore b/kotlin/resistor-color/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/kotlin/resistor-color/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/kotlin/resistor-color/.idea/compiler.xml b/kotlin/resistor-color/.idea/compiler.xml new file mode 100644 index 0000000..7e7ee62 --- /dev/null +++ b/kotlin/resistor-color/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/resistor-color/.idea/jarRepositories.xml b/kotlin/resistor-color/.idea/jarRepositories.xml new file mode 100644 index 0000000..efa4625 --- /dev/null +++ b/kotlin/resistor-color/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/resistor-color/.idea/misc.xml b/kotlin/resistor-color/.idea/misc.xml new file mode 100644 index 0000000..b9d0e72 --- /dev/null +++ b/kotlin/resistor-color/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/kotlin/resistor-color/.idea/vcs.xml b/kotlin/resistor-color/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/kotlin/resistor-color/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/resistor-color/src/main/kotlin/ResistorColor.kt b/kotlin/resistor-color/src/main/kotlin/ResistorColor.kt index bf94e13..bb7d088 100644 --- a/kotlin/resistor-color/src/main/kotlin/ResistorColor.kt +++ b/kotlin/resistor-color/src/main/kotlin/ResistorColor.kt @@ -1,11 +1,20 @@ object ResistorColor { fun colorCode(input: String): Int { - TODO("Implement this to complete the task") - } - - fun colors(): List { - TODO("Implement this to complete the task") + return when (input) { + "black" -> 0 + "brown" -> 1 + "red" -> 2 + "orange" -> 3 + "yellow" -> 4 + "green" -> 5 + "blue" -> 6 + "violet" -> 7 + "grey" -> 8 + "white" -> 9 + else -> throw IllegalArgumentException() + } } + fun colors(): List = listOf("black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white") }