From 69ae16879cdf8b4de928fede524c1243b7b32d54 Mon Sep 17 00:00:00 2001 From: Date: Thu, 20 Jul 2017 20:26:53 -0400 Subject: [PATCH] Fast-forward to later exercises - Saddle Point in progress --- .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/atbash-cipher/.idea/compiler.xml | 9 + kotlin/atbash-cipher/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/atbash-cipher/.idea/misc.xml | 6 + kotlin/atbash-cipher/.idea/modules.xml | 10 + .../.idea/modules/atbash-cipher_main.iml | 39 + .../.idea/modules/atbash-cipher_test.iml | 45 + kotlin/atbash-cipher/.idea/workspace.xml | 746 +++++++++++ kotlin/atbash-cipher/README.md | 37 + kotlin/atbash-cipher/atbash-cipher.iml | 13 + kotlin/atbash-cipher/build.gradle | 28 + .../build/kotlin-build/caches/version.txt | 1 + .../production/classes/Atbash$Companion.class | Bin 0 -> 4107 bytes .../out/production/classes/Atbash.class | Bin 0 -> 683 bytes .../out/production/classes/AtbashKt.class | Bin 0 -> 2742 bytes .../META-INF/atbash-cipher_main.kotlin_module | Bin 0 -> 30 bytes .../AtbashTest$DecodeTest$Companion.class | Bin 0 -> 2175 bytes .../test/classes/AtbashTest$DecodeTest.class | Bin 0 -> 2336 bytes .../AtbashTest$EncodeTest$Companion.class | Bin 0 -> 2593 bytes .../test/classes/AtbashTest$EncodeTest.class | Bin 0 -> 2336 bytes .../out/test/classes/AtbashTest.class | Bin 0 -> 693 bytes kotlin/atbash-cipher/src/main/kotlin/.keep | 0 .../atbash-cipher/src/main/kotlin/Atbash.kt | 54 + .../src/test/kotlin/AtbashTest.kt | 53 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/collatz-conjecture/.idea/compiler.xml | 9 + kotlin/collatz-conjecture/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/collatz-conjecture/.idea/misc.xml | 6 + kotlin/collatz-conjecture/.idea/modules.xml | 10 + .../.idea/modules/collatz-conjecture_main.iml | 39 + .../.idea/modules/collatz-conjecture_test.iml | 45 + kotlin/collatz-conjecture/.idea/workspace.xml | 717 +++++++++++ kotlin/collatz-conjecture/README.md | 36 + kotlin/collatz-conjecture/build.gradle | 28 + .../build/kotlin-build/caches/version.txt | 1 + .../collatz-conjecture/collatz-conjecture.iml | 13 + .../classes/CollatzCalculator$Companion.class | Bin 0 -> 1466 bytes .../classes/CollatzCalculator.class | Bin 0 -> 743 bytes .../test/classes/CollatzCalculatorTest.class | Bin 0 -> 2504 bytes .../collatz-conjecture/src/main/kotlin/.keep | 0 .../src/main/kotlin/CollatzCalculator.kt | 17 + .../src/test/kotlin/CollatzCalculatorTest.kt | 52 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/grains/.idea/compiler.xml | 9 + kotlin/grains/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/grains/.idea/misc.xml | 6 + kotlin/grains/.idea/modules.xml | 10 + kotlin/grains/.idea/modules/grains_main.iml | 39 + kotlin/grains/.idea/modules/grains_test.iml | 45 + kotlin/grains/.idea/workspace.xml | 720 +++++++++++ kotlin/grains/README.md | 36 + kotlin/grains/build.gradle | 28 + .../build/kotlin-build/caches/version.txt | 1 + kotlin/grains/grains.iml | 13 + .../grains/out/production/classes/Board.class | Bin 0 -> 1864 bytes .../grains/out/test/classes/BoardTest.class | Bin 0 -> 3363 bytes kotlin/grains/src/main/kotlin/.keep | 0 kotlin/grains/src/main/kotlin/Board.kt | 17 + kotlin/grains/src/test/kotlin/BoardTest.kt | 91 ++ kotlin/hello-world/GETTING_STARTED.md | 50 + kotlin/hello-world/README.md | 23 + kotlin/hello-world/TUTORIAL.md | 692 ++++++++++ kotlin/hello-world/build.gradle | 28 + .../hello-world/src/main/kotlin/HelloWorld.kt | 7 + .../src/test/kotlin/HelloWorldTest.kt | 30 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../luhn/.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/luhn/.idea/compiler.xml | 9 + kotlin/luhn/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/luhn/.idea/misc.xml | 22 + kotlin/luhn/.idea/modules.xml | 10 + kotlin/luhn/.idea/modules/luhn_main.iml | 39 + kotlin/luhn/.idea/modules/luhn_test.iml | 45 + kotlin/luhn/.idea/workspace.xml | 1127 +++++++++++++++++ kotlin/luhn/README.md | 73 ++ kotlin/luhn/build.gradle | 28 + kotlin/luhn/build/classes/main/Luhn.class | Bin 0 -> 2614 bytes kotlin/luhn/build/classes/test/LuhnTest.class | Bin 0 -> 2692 bytes .../build/kotlin-build/caches/version.txt | 1 + kotlin/luhn/luhn.iml | 13 + kotlin/luhn/out/production/classes/Luhn.class | Bin 0 -> 2958 bytes kotlin/luhn/out/test/classes/LuhnTest.class | Bin 0 -> 2692 bytes kotlin/luhn/src/main/kotlin/.keep | 0 kotlin/luhn/src/main/kotlin/Luhn.kt | 20 + kotlin/luhn/src/test/kotlin/LuhnTest.kt | 88 ++ .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/nth-prime/.idea/compiler.xml | 9 + kotlin/nth-prime/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/nth-prime/.idea/misc.xml | 6 + kotlin/nth-prime/.idea/modules.xml | 10 + .../.idea/modules/nth-prime_main.iml | 39 + .../.idea/modules/nth-prime_test.iml | 45 + kotlin/nth-prime/.idea/workspace.xml | 714 +++++++++++ kotlin/nth-prime/README.md | 18 + kotlin/nth-prime/build.gradle | 28 + .../build/kotlin-build/caches/version.txt | 1 + kotlin/nth-prime/nth-prime.iml | 13 + .../META-INF/nth-prime_main.kotlin_module | Bin 0 -> 29 bytes .../production/classes/Prime$Companion.class | Bin 0 -> 1332 bytes .../out/production/classes/Prime.class | Bin 0 -> 674 bytes .../out/production/classes/PrimeKt.class | Bin 0 -> 581 bytes .../out/test/classes/PrimeTest.class | Bin 0 -> 1453 bytes kotlin/nth-prime/src/main/kotlin/.keep | 0 kotlin/nth-prime/src/main/kotlin/Prime.kt | 24 + kotlin/nth-prime/src/test/kotlin/PrimeTest.kt | 34 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/fileContent/fileContent.lock | Bin 0 -> 17 bytes .../.gradle/3.5/taskHistory/fileHashes.bin | Bin 0 -> 19797 bytes .../.gradle/3.5/taskHistory/fileSnapshots.bin | Bin 0 -> 30492 bytes .../.gradle/3.5/taskHistory/taskHistory.bin | Bin 0 -> 25951 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/raindrops/.idea/compiler.xml | 9 + kotlin/raindrops/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/raindrops/.idea/misc.xml | 22 + kotlin/raindrops/.idea/modules.xml | 10 + .../.idea/modules/raindrops_main.iml | 39 + .../.idea/modules/raindrops_test.iml | 45 + kotlin/raindrops/.idea/workspace.xml | 917 ++++++++++++++ kotlin/raindrops/README.md | 26 + kotlin/raindrops/build.gradle | 28 + .../build/classes/main/Raindrops.class | Bin 0 -> 1284 bytes .../test/RaindropsTest$Companion.class | Bin 0 -> 3060 bytes .../build/classes/test/RaindropsTest.class | Bin 0 -> 2246 bytes .../caches/artifact-difference.tab | Bin 0 -> 65536 bytes .../caches/artifact-difference.tab.keystream | Bin 0 -> 4096 bytes .../artifact-difference.tab.keystream.len | Bin 0 -> 8 bytes .../caches/artifact-difference.tab.len | Bin 0 -> 8 bytes .../caches/artifact-difference.tab.values.at | Bin 0 -> 226 bytes .../caches/artifact-difference.tab_i | Bin 0 -> 32768 bytes .../caches/artifact-difference.tab_i.len | Bin 0 -> 8 bytes .../build/kotlin-build/caches/version.txt | 1 + .../build/kotlin-classes/main/Raindrops.class | Bin 0 -> 1284 bytes .../test/RaindropsTest$Companion.class | Bin 0 -> 3060 bytes .../kotlin-classes/test/RaindropsTest.class | Bin 0 -> 2246 bytes .../kotlin/class-fq-name-to-source.tab | Bin 0 -> 65536 bytes .../class-fq-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../class-fq-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/class-fq-name-to-source.tab.len | Bin 0 -> 8 bytes .../class-fq-name-to-source.tab.values.at | Bin 0 -> 289 bytes .../kotlin/class-fq-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/class-fq-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab | Bin 0 -> 65536 bytes .../internal-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../internal-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab.len | Bin 0 -> 8 bytes .../internal-name-to-source.tab.values.at | Bin 0 -> 289 bytes .../kotlin/internal-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/internal-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../kotlin/proto.tab | Bin 0 -> 65536 bytes .../kotlin/proto.tab.keystream | Bin 0 -> 4096 bytes .../kotlin/proto.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/proto.tab.len | Bin 0 -> 8 bytes .../kotlin/proto.tab.values.at | Bin 0 -> 298 bytes .../kotlin/proto.tab_i | Bin 0 -> 32768 bytes .../kotlin/proto.tab_i.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab | Bin 0 -> 65536 bytes .../kotlin/source-to-classes.tab.keystream | Bin 0 -> 4096 bytes .../source-to-classes.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.values.at | Bin 0 -> 97 bytes .../kotlin/source-to-classes.tab_i | Bin 0 -> 32768 bytes .../kotlin/source-to-classes.tab_i.len | Bin 0 -> 8 bytes .../kotlin/sources-to-classfiles.tab | Bin 0 -> 65536 bytes .../sources-to-classfiles.tab.keystream | Bin 0 -> 4096 bytes .../sources-to-classfiles.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/sources-to-classfiles.tab.len | Bin 0 -> 8 bytes .../sources-to-classfiles.tab.values.at | Bin 0 -> 341 bytes .../kotlin/sources-to-classfiles.tab_i | Bin 0 -> 32768 bytes .../kotlin/sources-to-classfiles.tab_i.len | Bin 0 -> 8 bytes .../compileKotlin/caches/lookups/counters.tab | 2 + .../caches/lookups/file-to-id.tab | Bin 0 -> 65536 bytes .../caches/lookups/file-to-id.tab.keystream | Bin 0 -> 4096 bytes .../lookups/file-to-id.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/file-to-id.tab.len | Bin 0 -> 8 bytes .../caches/lookups/file-to-id.tab.values.at | Bin 0 -> 73 bytes .../caches/lookups/file-to-id.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/file-to-id.tab_i.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab | Bin 0 -> 65536 bytes .../caches/lookups/id-to-file.tab.keystream | Bin 0 -> 4096 bytes .../lookups/id-to-file.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab.values.at | Bin 0 -> 293 bytes .../caches/lookups/id-to-file.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/id-to-file.tab_i.len | Bin 0 -> 8 bytes .../compileKotlin/caches/lookups/lookups.tab | Bin 0 -> 65536 bytes .../caches/lookups/lookups.tab.keystream | Bin 0 -> 4096 bytes .../caches/lookups/lookups.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab.values.at | Bin 0 -> 385 bytes .../caches/lookups/lookups.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/lookups.tab_i.len | Bin 0 -> 8 bytes .../data-container-format-version.txt | 1 + .../experimental-format-version.txt | 1 + .../kotlin/compileKotlin/format-version.txt | 1 + .../compileKotlin/gradle-format-version.txt | 1 + .../build/kotlin/compileKotlin/last-build.bin | Bin 0 -> 81 bytes .../sync/kotlin-files-in-java-timestamps.bin | Bin 0 -> 83 bytes .../kotlin/class-fq-name-to-source.tab | Bin 0 -> 65536 bytes .../class-fq-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../class-fq-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/class-fq-name-to-source.tab.len | Bin 0 -> 8 bytes .../class-fq-name-to-source.tab.values.at | Bin 0 -> 177 bytes .../kotlin/class-fq-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/class-fq-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab | Bin 0 -> 65536 bytes .../internal-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../internal-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab.len | Bin 0 -> 8 bytes .../internal-name-to-source.tab.values.at | Bin 0 -> 177 bytes .../kotlin/internal-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/internal-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../kotlin/proto.tab | Bin 0 -> 65536 bytes .../kotlin/proto.tab.keystream | Bin 0 -> 4096 bytes .../kotlin/proto.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/proto.tab.len | Bin 0 -> 8 bytes .../kotlin/proto.tab.values.at | Bin 0 -> 479 bytes .../kotlin/proto.tab_i | Bin 0 -> 32768 bytes .../kotlin/proto.tab_i.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab | Bin 0 -> 65536 bytes .../kotlin/source-to-classes.tab.keystream | Bin 0 -> 4096 bytes .../source-to-classes.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.values.at | Bin 0 -> 89 bytes .../kotlin/source-to-classes.tab_i | Bin 0 -> 32768 bytes .../kotlin/source-to-classes.tab_i.len | Bin 0 -> 8 bytes .../kotlin/sources-to-classfiles.tab | Bin 0 -> 65536 bytes .../sources-to-classfiles.tab.keystream | Bin 0 -> 4096 bytes .../sources-to-classfiles.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/sources-to-classfiles.tab.len | Bin 0 -> 8 bytes .../sources-to-classfiles.tab.values.at | Bin 0 -> 211 bytes .../kotlin/sources-to-classfiles.tab_i | Bin 0 -> 32768 bytes .../kotlin/sources-to-classfiles.tab_i.len | Bin 0 -> 8 bytes .../caches/lookups/counters.tab | 2 + .../caches/lookups/file-to-id.tab | Bin 0 -> 65536 bytes .../caches/lookups/file-to-id.tab.keystream | Bin 0 -> 4096 bytes .../lookups/file-to-id.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/file-to-id.tab.len | Bin 0 -> 8 bytes .../caches/lookups/file-to-id.tab.values.at | Bin 0 -> 55 bytes .../caches/lookups/file-to-id.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/file-to-id.tab_i.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab | Bin 0 -> 65536 bytes .../caches/lookups/id-to-file.tab.keystream | Bin 0 -> 4096 bytes .../lookups/id-to-file.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab.values.at | Bin 0 -> 114 bytes .../caches/lookups/id-to-file.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/id-to-file.tab_i.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab | Bin 0 -> 65536 bytes .../caches/lookups/lookups.tab.keystream | Bin 0 -> 4096 bytes .../caches/lookups/lookups.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab.values.at | Bin 0 -> 709 bytes .../caches/lookups/lookups.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/lookups.tab_i.len | Bin 0 -> 8 bytes .../data-container-format-version.txt | 1 + .../experimental-format-version.txt | 1 + .../compileTestKotlin/format-version.txt | 1 + .../gradle-format-version.txt | 1 + .../kotlin/compileTestKotlin/last-build.bin | Bin 0 -> 81 bytes .../sync/kotlin-files-in-java-timestamps.bin | Bin 0 -> 174 bytes .../tests/test/classes/RaindropsTest.html | 171 +++ .../reports/tests/test/css/base-style.css | 179 +++ .../build/reports/tests/test/css/style.css | 84 ++ .../build/reports/tests/test/index.html | 132 ++ .../build/reports/tests/test/js/report.js | 194 +++ .../tests/test/packages/default-package.html | 103 ++ .../test-results/test/TEST-RaindropsTest.xml | 22 + .../build/test-results/test/binary/output.bin | 0 .../test-results/test/binary/output.bin.idx | Bin 0 -> 1 bytes .../test-results/test/binary/results.bin | Bin 0 -> 705 bytes kotlin/raindrops/raindrops.iml | 12 + kotlin/raindrops/src/main/kotlin/.keep | 0 kotlin/raindrops/src/main/kotlin/Raindrops.kt | 14 + .../src/test/kotlin/RaindropsTest.kt | 47 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/saddle-points/.idea/compiler.xml | 9 + kotlin/saddle-points/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/saddle-points/.idea/misc.xml | 6 + kotlin/saddle-points/.idea/modules.xml | 10 + .../.idea/modules/saddle-points_main.iml | 39 + .../.idea/modules/saddle-points_test.iml | 45 + kotlin/saddle-points/.idea/workspace.xml | 693 ++++++++++ kotlin/saddle-points/README.md | 36 + kotlin/saddle-points/build.gradle | 28 + .../build/kotlin-build/caches/version.txt | 1 + kotlin/saddle-points/saddle-points.iml | 13 + .../saddle-points/src/main/kotlin/Matrix.kt | 20 + .../src/main/kotlin/MatrixCoordinate.kt | 1 + .../src/test/kotlin/MatrixTest.kt | 80 ++ .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/secret-handshake/.idea/compiler.xml | 9 + kotlin/secret-handshake/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/secret-handshake/.idea/misc.xml | 22 + kotlin/secret-handshake/.idea/modules.xml | 10 + .../.idea/modules/secret-handshake_main.iml | 39 + .../.idea/modules/secret-handshake_test.iml | 45 + kotlin/secret-handshake/.idea/workspace.xml | 1028 +++++++++++++++ kotlin/secret-handshake/README.md | 37 + kotlin/secret-handshake/build.gradle | 28 + .../classes/main/HandshakeCalculator.class | Bin 0 -> 2309 bytes .../classes/main/HandshakeCalculatorKt.class | Bin 0 -> 1780 bytes .../secret-handshake_main.kotlin_module | Bin 0 -> 43 bytes .../build/classes/main/Signal.class | Bin 0 -> 1218 bytes .../test/HandshakeCalculatorTest.class | Bin 0 -> 3033 bytes .../build/kotlin-build/caches/version.txt | 1 + kotlin/secret-handshake/secret-handshake.iml | 12 + .../src/main/kotlin/HandshakeCalculator.kt | 37 + .../src/main/kotlin/Signal.kt | 5 + .../test/kotlin/HandshakeCalculatorTest.kt | 105 ++ .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/sieve/.idea/compiler.xml | 9 + kotlin/sieve/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/sieve/.idea/misc.xml | 6 + kotlin/sieve/.idea/modules.xml | 10 + kotlin/sieve/.idea/modules/sieve_main.iml | 39 + kotlin/sieve/.idea/modules/sieve_test.iml | 45 + kotlin/sieve/.idea/workspace.xml | 748 +++++++++++ kotlin/sieve/README.md | 36 + kotlin/sieve/build.gradle | 28 + .../build/kotlin-build/caches/version.txt | 1 + .../sieve/out/production/classes/Sieve.class | Bin 0 -> 2118 bytes kotlin/sieve/out/test/classes/SieveTest.class | Bin 0 -> 3143 bytes kotlin/sieve/sieve.iml | 13 + kotlin/sieve/src/main/kotlin/.keep | 0 kotlin/sieve/src/main/kotlin/Sieve.kt | 22 + kotlin/sieve/src/test/kotlin/SieveTest.kt | 36 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/sum-of-multiples/.idea/compiler.xml | 9 + kotlin/sum-of-multiples/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/sum-of-multiples/.idea/misc.xml | 22 + kotlin/sum-of-multiples/.idea/modules.xml | 10 + .../.idea/modules/sum-of-multiples_main.iml | 39 + .../.idea/modules/sum-of-multiples_test.iml | 45 + kotlin/sum-of-multiples/.idea/workspace.xml | 931 ++++++++++++++ kotlin/sum-of-multiples/README.md | 20 + kotlin/sum-of-multiples/build.gradle | 29 + .../build/classes/main/SumOfMultiples.class | Bin 0 -> 1930 bytes .../classes/test/SumOfMultiplesTest.class | Bin 0 -> 3119 bytes .../build/kotlin-build/caches/version.txt | 1 + kotlin/sum-of-multiples/src/main/kotlin/.keep | 0 .../src/main/kotlin/SumOfMultiples.kt | 13 + .../src/test/kotlin/SumOfMultiplesTest.kt | 84 ++ kotlin/sum-of-multiples/sum-of-multiples.iml | 12 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/triangle/.idea/compiler.xml | 9 + kotlin/triangle/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/triangle/.idea/misc.xml | 6 + kotlin/triangle/.idea/modules.xml | 10 + .../triangle/.idea/modules/triangle_main.iml | 39 + .../triangle/.idea/modules/triangle_test.iml | 45 + kotlin/triangle/.idea/workspace.xml | 881 +++++++++++++ kotlin/triangle/README.md | 29 + kotlin/triangle/build.gradle | 29 + .../build/kotlin-build/caches/version.txt | 1 + .../out/production/classes/Triangle.class | Bin 0 -> 2134 bytes .../out/test/classes/TriangleTest.class | Bin 0 -> 3265 bytes kotlin/triangle/src/main/kotlin/.keep | 0 kotlin/triangle/src/main/kotlin/Triangle.kt | 12 + .../triangle/src/test/kotlin/TriangleTest.kt | 109 ++ kotlin/triangle/triangle.iml | 13 + 468 files changed, 15060 insertions(+) create mode 100644 kotlin/atbash-cipher/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/atbash-cipher/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/atbash-cipher/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/atbash-cipher/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/atbash-cipher/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/atbash-cipher/.idea/compiler.xml create mode 100644 kotlin/atbash-cipher/.idea/gradle.xml create mode 100644 kotlin/atbash-cipher/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/atbash-cipher/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/atbash-cipher/.idea/misc.xml create mode 100644 kotlin/atbash-cipher/.idea/modules.xml create mode 100644 kotlin/atbash-cipher/.idea/modules/atbash-cipher_main.iml create mode 100644 kotlin/atbash-cipher/.idea/modules/atbash-cipher_test.iml create mode 100644 kotlin/atbash-cipher/.idea/workspace.xml create mode 100644 kotlin/atbash-cipher/README.md create mode 100644 kotlin/atbash-cipher/atbash-cipher.iml create mode 100644 kotlin/atbash-cipher/build.gradle create mode 100644 kotlin/atbash-cipher/build/kotlin-build/caches/version.txt create mode 100644 kotlin/atbash-cipher/out/production/classes/Atbash$Companion.class create mode 100644 kotlin/atbash-cipher/out/production/classes/Atbash.class create mode 100644 kotlin/atbash-cipher/out/production/classes/AtbashKt.class create mode 100644 kotlin/atbash-cipher/out/production/classes/META-INF/atbash-cipher_main.kotlin_module create mode 100644 kotlin/atbash-cipher/out/test/classes/AtbashTest$DecodeTest$Companion.class create mode 100644 kotlin/atbash-cipher/out/test/classes/AtbashTest$DecodeTest.class create mode 100644 kotlin/atbash-cipher/out/test/classes/AtbashTest$EncodeTest$Companion.class create mode 100644 kotlin/atbash-cipher/out/test/classes/AtbashTest$EncodeTest.class create mode 100644 kotlin/atbash-cipher/out/test/classes/AtbashTest.class create mode 100644 kotlin/atbash-cipher/src/main/kotlin/.keep create mode 100644 kotlin/atbash-cipher/src/main/kotlin/Atbash.kt create mode 100644 kotlin/atbash-cipher/src/test/kotlin/AtbashTest.kt create mode 100644 kotlin/collatz-conjecture/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/collatz-conjecture/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/collatz-conjecture/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/collatz-conjecture/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/collatz-conjecture/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/collatz-conjecture/.idea/compiler.xml create mode 100644 kotlin/collatz-conjecture/.idea/gradle.xml create mode 100644 kotlin/collatz-conjecture/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/collatz-conjecture/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/collatz-conjecture/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/collatz-conjecture/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/collatz-conjecture/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/collatz-conjecture/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/collatz-conjecture/.idea/misc.xml create mode 100644 kotlin/collatz-conjecture/.idea/modules.xml create mode 100644 kotlin/collatz-conjecture/.idea/modules/collatz-conjecture_main.iml create mode 100644 kotlin/collatz-conjecture/.idea/modules/collatz-conjecture_test.iml create mode 100644 kotlin/collatz-conjecture/.idea/workspace.xml create mode 100644 kotlin/collatz-conjecture/README.md create mode 100644 kotlin/collatz-conjecture/build.gradle create mode 100644 kotlin/collatz-conjecture/build/kotlin-build/caches/version.txt create mode 100644 kotlin/collatz-conjecture/collatz-conjecture.iml create mode 100644 kotlin/collatz-conjecture/out/production/classes/CollatzCalculator$Companion.class create mode 100644 kotlin/collatz-conjecture/out/production/classes/CollatzCalculator.class create mode 100644 kotlin/collatz-conjecture/out/test/classes/CollatzCalculatorTest.class create mode 100644 kotlin/collatz-conjecture/src/main/kotlin/.keep create mode 100644 kotlin/collatz-conjecture/src/main/kotlin/CollatzCalculator.kt create mode 100644 kotlin/collatz-conjecture/src/test/kotlin/CollatzCalculatorTest.kt create mode 100644 kotlin/grains/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/grains/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/grains/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/grains/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/grains/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/grains/.idea/compiler.xml create mode 100644 kotlin/grains/.idea/gradle.xml create mode 100644 kotlin/grains/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/grains/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/grains/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/grains/.idea/misc.xml create mode 100644 kotlin/grains/.idea/modules.xml create mode 100644 kotlin/grains/.idea/modules/grains_main.iml create mode 100644 kotlin/grains/.idea/modules/grains_test.iml create mode 100644 kotlin/grains/.idea/workspace.xml create mode 100644 kotlin/grains/README.md create mode 100644 kotlin/grains/build.gradle create mode 100644 kotlin/grains/build/kotlin-build/caches/version.txt create mode 100644 kotlin/grains/grains.iml create mode 100644 kotlin/grains/out/production/classes/Board.class create mode 100644 kotlin/grains/out/test/classes/BoardTest.class create mode 100644 kotlin/grains/src/main/kotlin/.keep create mode 100644 kotlin/grains/src/main/kotlin/Board.kt create mode 100644 kotlin/grains/src/test/kotlin/BoardTest.kt create mode 100644 kotlin/hello-world/GETTING_STARTED.md create mode 100644 kotlin/hello-world/README.md create mode 100644 kotlin/hello-world/TUTORIAL.md create mode 100644 kotlin/hello-world/build.gradle create mode 100644 kotlin/hello-world/src/main/kotlin/HelloWorld.kt create mode 100644 kotlin/hello-world/src/test/kotlin/HelloWorldTest.kt create mode 100644 kotlin/luhn/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/luhn/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/luhn/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/luhn/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/luhn/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/luhn/.idea/compiler.xml create mode 100644 kotlin/luhn/.idea/gradle.xml create mode 100644 kotlin/luhn/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/luhn/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/luhn/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/luhn/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/luhn/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/luhn/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/luhn/.idea/misc.xml create mode 100644 kotlin/luhn/.idea/modules.xml create mode 100644 kotlin/luhn/.idea/modules/luhn_main.iml create mode 100644 kotlin/luhn/.idea/modules/luhn_test.iml create mode 100644 kotlin/luhn/.idea/workspace.xml create mode 100644 kotlin/luhn/README.md create mode 100644 kotlin/luhn/build.gradle create mode 100644 kotlin/luhn/build/classes/main/Luhn.class create mode 100644 kotlin/luhn/build/classes/test/LuhnTest.class create mode 100644 kotlin/luhn/build/kotlin-build/caches/version.txt create mode 100644 kotlin/luhn/luhn.iml create mode 100644 kotlin/luhn/out/production/classes/Luhn.class create mode 100644 kotlin/luhn/out/test/classes/LuhnTest.class create mode 100644 kotlin/luhn/src/main/kotlin/.keep create mode 100644 kotlin/luhn/src/main/kotlin/Luhn.kt create mode 100644 kotlin/luhn/src/test/kotlin/LuhnTest.kt create mode 100644 kotlin/nth-prime/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/nth-prime/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/nth-prime/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/nth-prime/.idea/compiler.xml create mode 100644 kotlin/nth-prime/.idea/gradle.xml create mode 100644 kotlin/nth-prime/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/nth-prime/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/nth-prime/.idea/misc.xml create mode 100644 kotlin/nth-prime/.idea/modules.xml create mode 100644 kotlin/nth-prime/.idea/modules/nth-prime_main.iml create mode 100644 kotlin/nth-prime/.idea/modules/nth-prime_test.iml create mode 100644 kotlin/nth-prime/.idea/workspace.xml create mode 100644 kotlin/nth-prime/README.md create mode 100644 kotlin/nth-prime/build.gradle create mode 100644 kotlin/nth-prime/build/kotlin-build/caches/version.txt create mode 100644 kotlin/nth-prime/nth-prime.iml create mode 100644 kotlin/nth-prime/out/production/classes/META-INF/nth-prime_main.kotlin_module create mode 100644 kotlin/nth-prime/out/production/classes/Prime$Companion.class create mode 100644 kotlin/nth-prime/out/production/classes/Prime.class create mode 100644 kotlin/nth-prime/out/production/classes/PrimeKt.class create mode 100644 kotlin/nth-prime/out/test/classes/PrimeTest.class create mode 100644 kotlin/nth-prime/src/main/kotlin/.keep create mode 100644 kotlin/nth-prime/src/main/kotlin/Prime.kt create mode 100644 kotlin/nth-prime/src/test/kotlin/PrimeTest.kt create mode 100644 kotlin/raindrops/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/raindrops/.gradle/3.5/fileContent/fileContent.lock create mode 100644 kotlin/raindrops/.gradle/3.5/taskHistory/fileHashes.bin create mode 100644 kotlin/raindrops/.gradle/3.5/taskHistory/fileSnapshots.bin create mode 100644 kotlin/raindrops/.gradle/3.5/taskHistory/taskHistory.bin create mode 100644 kotlin/raindrops/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/raindrops/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/raindrops/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/raindrops/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/raindrops/.idea/compiler.xml create mode 100644 kotlin/raindrops/.idea/gradle.xml create mode 100644 kotlin/raindrops/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/raindrops/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/raindrops/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/raindrops/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/raindrops/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/raindrops/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/raindrops/.idea/misc.xml create mode 100644 kotlin/raindrops/.idea/modules.xml create mode 100644 kotlin/raindrops/.idea/modules/raindrops_main.iml create mode 100644 kotlin/raindrops/.idea/modules/raindrops_test.iml create mode 100644 kotlin/raindrops/.idea/workspace.xml create mode 100644 kotlin/raindrops/README.md create mode 100644 kotlin/raindrops/build.gradle create mode 100644 kotlin/raindrops/build/classes/main/Raindrops.class create mode 100644 kotlin/raindrops/build/classes/test/RaindropsTest$Companion.class create mode 100644 kotlin/raindrops/build/classes/test/RaindropsTest.class create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab.len create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab_i create mode 100644 kotlin/raindrops/build/kotlin-build/caches/artifact-difference.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin-build/caches/version.txt create mode 100644 kotlin/raindrops/build/kotlin-classes/main/Raindrops.class create mode 100644 kotlin/raindrops/build/kotlin-classes/test/RaindropsTest$Companion.class create mode 100644 kotlin/raindrops/build/kotlin-classes/test/RaindropsTest.class create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/proto.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/counters.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/caches/lookups/lookups.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/data-container-format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/experimental-format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/gradle-format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/last-build.bin create mode 100644 kotlin/raindrops/build/kotlin/compileKotlin/sync/kotlin-files-in-java-timestamps.bin create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/class-fq-name-to-source.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/internal-name-to-source.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/proto.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/source-to-classes.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/increCache.raindrops_main/kotlin/sources-to-classfiles.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/counters.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/file-to-id.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/id-to-file.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab.keystream create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab.keystream.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab.values.at create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab_i create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/caches/lookups/lookups.tab_i.len create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/data-container-format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/experimental-format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/gradle-format-version.txt create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/last-build.bin create mode 100644 kotlin/raindrops/build/kotlin/compileTestKotlin/sync/kotlin-files-in-java-timestamps.bin create mode 100644 kotlin/raindrops/build/reports/tests/test/classes/RaindropsTest.html create mode 100644 kotlin/raindrops/build/reports/tests/test/css/base-style.css create mode 100644 kotlin/raindrops/build/reports/tests/test/css/style.css create mode 100644 kotlin/raindrops/build/reports/tests/test/index.html create mode 100644 kotlin/raindrops/build/reports/tests/test/js/report.js create mode 100644 kotlin/raindrops/build/reports/tests/test/packages/default-package.html create mode 100644 kotlin/raindrops/build/test-results/test/TEST-RaindropsTest.xml create mode 100644 kotlin/raindrops/build/test-results/test/binary/output.bin create mode 100644 kotlin/raindrops/build/test-results/test/binary/output.bin.idx create mode 100644 kotlin/raindrops/build/test-results/test/binary/results.bin create mode 100644 kotlin/raindrops/raindrops.iml create mode 100644 kotlin/raindrops/src/main/kotlin/.keep create mode 100644 kotlin/raindrops/src/main/kotlin/Raindrops.kt create mode 100644 kotlin/raindrops/src/test/kotlin/RaindropsTest.kt create mode 100644 kotlin/saddle-points/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/saddle-points/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/saddle-points/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/saddle-points/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/saddle-points/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/saddle-points/.idea/compiler.xml create mode 100644 kotlin/saddle-points/.idea/gradle.xml create mode 100644 kotlin/saddle-points/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/saddle-points/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/saddle-points/.idea/misc.xml create mode 100644 kotlin/saddle-points/.idea/modules.xml create mode 100644 kotlin/saddle-points/.idea/modules/saddle-points_main.iml create mode 100644 kotlin/saddle-points/.idea/modules/saddle-points_test.iml create mode 100644 kotlin/saddle-points/.idea/workspace.xml create mode 100644 kotlin/saddle-points/README.md create mode 100644 kotlin/saddle-points/build.gradle create mode 100644 kotlin/saddle-points/build/kotlin-build/caches/version.txt create mode 100644 kotlin/saddle-points/saddle-points.iml create mode 100644 kotlin/saddle-points/src/main/kotlin/Matrix.kt create mode 100644 kotlin/saddle-points/src/main/kotlin/MatrixCoordinate.kt create mode 100644 kotlin/saddle-points/src/test/kotlin/MatrixTest.kt create mode 100644 kotlin/secret-handshake/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/secret-handshake/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/secret-handshake/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/secret-handshake/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/secret-handshake/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/secret-handshake/.idea/compiler.xml create mode 100644 kotlin/secret-handshake/.idea/gradle.xml create mode 100644 kotlin/secret-handshake/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/secret-handshake/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/secret-handshake/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/secret-handshake/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/secret-handshake/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/secret-handshake/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/secret-handshake/.idea/misc.xml create mode 100644 kotlin/secret-handshake/.idea/modules.xml create mode 100644 kotlin/secret-handshake/.idea/modules/secret-handshake_main.iml create mode 100644 kotlin/secret-handshake/.idea/modules/secret-handshake_test.iml create mode 100644 kotlin/secret-handshake/.idea/workspace.xml create mode 100644 kotlin/secret-handshake/README.md create mode 100644 kotlin/secret-handshake/build.gradle create mode 100644 kotlin/secret-handshake/build/classes/main/HandshakeCalculator.class create mode 100644 kotlin/secret-handshake/build/classes/main/HandshakeCalculatorKt.class create mode 100644 kotlin/secret-handshake/build/classes/main/META-INF/secret-handshake_main.kotlin_module create mode 100644 kotlin/secret-handshake/build/classes/main/Signal.class create mode 100644 kotlin/secret-handshake/build/classes/test/HandshakeCalculatorTest.class create mode 100644 kotlin/secret-handshake/build/kotlin-build/caches/version.txt create mode 100644 kotlin/secret-handshake/secret-handshake.iml create mode 100644 kotlin/secret-handshake/src/main/kotlin/HandshakeCalculator.kt create mode 100644 kotlin/secret-handshake/src/main/kotlin/Signal.kt create mode 100644 kotlin/secret-handshake/src/test/kotlin/HandshakeCalculatorTest.kt create mode 100644 kotlin/sieve/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/sieve/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/sieve/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/sieve/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/sieve/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/sieve/.idea/compiler.xml create mode 100644 kotlin/sieve/.idea/gradle.xml create mode 100644 kotlin/sieve/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/sieve/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/sieve/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/sieve/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/sieve/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/sieve/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/sieve/.idea/misc.xml create mode 100644 kotlin/sieve/.idea/modules.xml create mode 100644 kotlin/sieve/.idea/modules/sieve_main.iml create mode 100644 kotlin/sieve/.idea/modules/sieve_test.iml create mode 100644 kotlin/sieve/.idea/workspace.xml create mode 100644 kotlin/sieve/README.md create mode 100644 kotlin/sieve/build.gradle create mode 100644 kotlin/sieve/build/kotlin-build/caches/version.txt create mode 100644 kotlin/sieve/out/production/classes/Sieve.class create mode 100644 kotlin/sieve/out/test/classes/SieveTest.class create mode 100644 kotlin/sieve/sieve.iml create mode 100644 kotlin/sieve/src/main/kotlin/.keep create mode 100644 kotlin/sieve/src/main/kotlin/Sieve.kt create mode 100644 kotlin/sieve/src/test/kotlin/SieveTest.kt create mode 100644 kotlin/sum-of-multiples/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/sum-of-multiples/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/sum-of-multiples/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/sum-of-multiples/.idea/compiler.xml create mode 100644 kotlin/sum-of-multiples/.idea/gradle.xml create mode 100644 kotlin/sum-of-multiples/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/sum-of-multiples/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/sum-of-multiples/.idea/misc.xml create mode 100644 kotlin/sum-of-multiples/.idea/modules.xml create mode 100644 kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_main.iml create mode 100644 kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_test.iml create mode 100644 kotlin/sum-of-multiples/.idea/workspace.xml create mode 100644 kotlin/sum-of-multiples/README.md create mode 100644 kotlin/sum-of-multiples/build.gradle create mode 100644 kotlin/sum-of-multiples/build/classes/main/SumOfMultiples.class create mode 100644 kotlin/sum-of-multiples/build/classes/test/SumOfMultiplesTest.class create mode 100644 kotlin/sum-of-multiples/build/kotlin-build/caches/version.txt create mode 100644 kotlin/sum-of-multiples/src/main/kotlin/.keep create mode 100644 kotlin/sum-of-multiples/src/main/kotlin/SumOfMultiples.kt create mode 100644 kotlin/sum-of-multiples/src/test/kotlin/SumOfMultiplesTest.kt create mode 100644 kotlin/sum-of-multiples/sum-of-multiples.iml create mode 100644 kotlin/triangle/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/triangle/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/triangle/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/triangle/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/triangle/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/triangle/.idea/compiler.xml create mode 100644 kotlin/triangle/.idea/gradle.xml create mode 100644 kotlin/triangle/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/triangle/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/triangle/.idea/misc.xml create mode 100644 kotlin/triangle/.idea/modules.xml create mode 100644 kotlin/triangle/.idea/modules/triangle_main.iml create mode 100644 kotlin/triangle/.idea/modules/triangle_test.iml create mode 100644 kotlin/triangle/.idea/workspace.xml create mode 100644 kotlin/triangle/README.md create mode 100644 kotlin/triangle/build.gradle create mode 100644 kotlin/triangle/build/kotlin-build/caches/version.txt create mode 100644 kotlin/triangle/out/production/classes/Triangle.class create mode 100644 kotlin/triangle/out/test/classes/TriangleTest.class create mode 100644 kotlin/triangle/src/main/kotlin/.keep create mode 100644 kotlin/triangle/src/main/kotlin/Triangle.kt create mode 100644 kotlin/triangle/src/test/kotlin/TriangleTest.kt create mode 100644 kotlin/triangle/triangle.iml diff --git a/kotlin/atbash-cipher/.gradle/3.5/file-changes/last-build.bin b/kotlin/atbash-cipher/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/atbash-cipher/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/atbash-cipher/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..5e3e3fac7e2f5d734f3aadd5ef787570486e0eb6 GIT binary patch literal 17 ScmZQ(j&M0IYAh + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/gradle.xml b/kotlin/atbash-cipher/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/atbash-cipher/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..c4f27b9 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..e29af23 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..8dc5a86 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..caa2881 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..6325d98 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..1f91870 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/misc.xml b/kotlin/atbash-cipher/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/modules.xml b/kotlin/atbash-cipher/.idea/modules.xml new file mode 100644 index 0000000..79a82a3 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/modules/atbash-cipher_main.iml b/kotlin/atbash-cipher/.idea/modules/atbash-cipher_main.iml new file mode 100644 index 0000000..10e6286 --- /dev/null +++ b/kotlin/atbash-cipher/.idea/modules/atbash-cipher_main.iml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/modules/atbash-cipher_test.iml b/kotlin/atbash-cipher/.idea/modules/atbash-cipher_test.iml new file mode 100644 index 0000000..38bbaee --- /dev/null +++ b/kotlin/atbash-cipher/.idea/modules/atbash-cipher_test.iml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/atbash-cipher/.idea/workspace.xml b/kotlin/atbash-cipher/.idea/workspace.xml new file mode 100644 index 0000000..4ad3b6a --- /dev/null +++ b/kotlin/atbash-cipher/.idea/workspace.xml @@ -0,0 +1,746 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1500477383851 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/kotlin/collatz-conjecture/README.md b/kotlin/collatz-conjecture/README.md new file mode 100644 index 0000000..8a6827d --- /dev/null +++ b/kotlin/collatz-conjecture/README.md @@ -0,0 +1,36 @@ +# Collatz Conjecture + +The Collatz Conjecture or 3x+1 problem can be summarized as follows: + +Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is +odd, multiply n by 3 and add 1 to get 3n + 1. Repeat the process indefinitely. +The conjecture states that no matter which number you start with, you will +always reach 1 eventually. + +Given a number n, return the number of steps required to reach 1. + +## Examples +Starting with n = 12, the steps would be as follows: + +0. 12 +1. 6 +2. 3 +3. 10 +4. 5 +5. 16 +6. 8 +7. 4 +8. 2 +9. 1 + +Resulting in 9 steps. So for input n = 12, the return value would be 9. + + + + +## Source + +An unsolved problem in mathematics named after mathematician Lothar Collatz [https://en.wikipedia.org/wiki/3x_%2B_1_problem](https://en.wikipedia.org/wiki/3x_%2B_1_problem) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/kotlin/collatz-conjecture/build.gradle b/kotlin/collatz-conjecture/build.gradle new file mode 100644 index 0000000..0e6528d --- /dev/null +++ b/kotlin/collatz-conjecture/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/collatz-conjecture/build/kotlin-build/caches/version.txt b/kotlin/collatz-conjecture/build/kotlin-build/caches/version.txt new file mode 100644 index 0000000..01aabac --- /dev/null +++ b/kotlin/collatz-conjecture/build/kotlin-build/caches/version.txt @@ -0,0 +1 @@ +11001 \ No newline at end of file diff --git a/kotlin/collatz-conjecture/collatz-conjecture.iml b/kotlin/collatz-conjecture/collatz-conjecture.iml new file mode 100644 index 0000000..93260f9 --- /dev/null +++ b/kotlin/collatz-conjecture/collatz-conjecture.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/collatz-conjecture/out/production/classes/CollatzCalculator$Companion.class b/kotlin/collatz-conjecture/out/production/classes/CollatzCalculator$Companion.class new file mode 100644 index 0000000000000000000000000000000000000000..9c4aff0f19ec301119c8d4b61fdfebd27f53068c GIT binary patch literal 1466 zcmb7EOK%%h6#ni!Y-ey2=TY)gOw#u+Au zfgbLM!6V-EMG}(?qj@jS^ObxkzKFe0Fff8-M}#sWgi3U}n(TWdE!6*`b=28}C%ZM> z7_-n%p4D|OFjNZl!$A3-EFTq?-EAFcz-lw&KaxLS|Vd>diFy?hi$DfN`h&( zzjQYUk6x)b6a>eURNIA~CQ)V>dA^gh2Nz6M4)yv~gBHzeq8_;1-{qmFXZlbd3}baq ziVu6MIM7^bDDEEa@a{l%8bKVo;=ZTNr~1M@(Tv;MkCl)Sts_IaCZ!0gK93?n^Pl~g z*52!gT`%$|%a)XZ;(Bo-RA^onbrLW!4jT!={5na0kZcouZ{GYKN$UibxtV=}>50_3 z^(&lDX04ww`V0>$A-nxS207Jp_5`3b3`>aPdbJ-h+jjRPK&%PD%HX@inK@tFCmF# zr09MGx9KB$hwSc>ZX2U`lRPp=j=anM!VLXQHg4OLV+`2=&@xe)H0;t-yz&z<29*d3 z(Nhiz(dl((=r%($!WH6mmu?f)1#9Qr(7BJoevZP%tAwtPVi1Pvzoo-b)o&3E8#`Mc zIWJll=Y!q{=#(0{bMC%#Jy*%S(D;IK_(VFTx>LDUS+3k#uQ;V`hl&S1F&e-st-&nT xNv@Hs`fgc5PfUs(-@kxg(ieTfdT;uOmd_Z5*Q&>NoCP+q*T}ohfm419 zC$5M?C6G|mBR>i;o3!N+$vZo5X5RSi%%8tMe*@^E%}@{1IOgU{$m1v{C(X)W47D+z z@*w8wWAJ)77Lh5#Whm`SCCyU?w|&3wqll7+0?G^p^GRxkjowPPJ%-AD6rb{{VVZpA zN~Vfod$oA?JWaHEZ;~1!28Y7%5jUJ-PBL{#IkTojaJYbAU=u>44nuoB^F62Gcus9T z^PGy?n9p|HuJf2ZVea$d$=8xob56dM3bww>s28@P

@|sj^SaGx0v*k|efPp7UQ} z8CMxP?K6?%X%a|fM5cHgybvFF9-A;#+GKe|Lp|i#L}Yu*sa^BX!nO||7prh^gJE;! zM~^0k#u}z0!LZ&-BOdp8CiyTHZ>?ci>q#YE<;hTFrxEW>nrD%CDQ((6P)cNB%(WJ@ zndVWhj7&sdYDx5GN~MMy+Ji=iBoypW(X@)lbI7ONlD$PJpqu7|;)7#UzAw_Z$@)c2-~ayk7l1iD6d2AsmSuR~ z_S?2(q0r6*;%=b4TzaIWaM)$ERM zn_kxSEvd3g-AePs>(E-G7DdCwUB|ObJG)b_WpCDN%cis{l(zt-x8)k9t+Iw~JD#D9 zsqBj5t@xHjtx1orK9H`n?#Vs1CLjBzD=T-mrM>PMu4mfSW!I@)76_&@rPuB2Ac-*a zD#U{A$*Oe2I3f_P8s4CI~Ko?$ogGhXb` zIp01e*f2&0Z~{qz(L)r&ILRQ&g!MhCL(V(C?FsbJ$3hIF7>nW*#syNXr0Vo!b4p3( zf|rB`oXef)v$7I)vrn0YmY=2GXiJ+cPPS`6$mv4iiPQ{K;B}R=5;3L@Lm*` z@jks=wXLTUw&D4%VNKYLRH+HWl@o?#Ip4}k1Rn|65`V|J^nRTY6F$Zr;1pU2ga?Y>C@F@nP=)*OZ*mi7Mx{%IvjQHCYK@1DXY0Hc3 z)Sf*tqoLB72(Am9?pO{c-EwWi%F;jfoifWRjAeoG^0qAR62@h`Y>twi+=6N?34y83 z=zH6`BOfzv4Hg1omt2KQ=KJT*PDKN$ zKr|44{wx}ZkRYSUILSyT_59gfU{);lzxXLc(alJ_|5RW$bR$eE+@>OJYM@O;+tgr_ zT1&)(r24Le7DD%4{BTqw($b5cLow~loS>sfmYbXXQrWTf_V!)*u*Pl5toJOL4K~2c zF1NtRHLeu1CQF>OElcKJ?OpDs)*0vG4X1s1r@|gc6rHkRl?>N3cz;8`1dbI=TQ*0# zC5f&(zFU^drX|@40k)BLS?DPvcV8!&T$tYne4>;^_#NOA#t`{IN;b*md4thnICy}> zuSoUn<1{G|76&;03l9SLitkuc2^TO)?rT085=e0C9&ekAQ8I+7Hu&`x_(-@39*-Y} zKGK7p1B}JDNm?g=RPDZFrQve#83#+-um_BwCTBxV?#B0V|E)D!zEh-Jt+$`n66?g$;bU fi6aV=3MGX>g?@#QLZ-n^DWnyyDqK{ED%|}KbgoP` literal 0 HcmV?d00001 diff --git a/kotlin/collatz-conjecture/src/main/kotlin/.keep b/kotlin/collatz-conjecture/src/main/kotlin/.keep new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/collatz-conjecture/src/main/kotlin/CollatzCalculator.kt b/kotlin/collatz-conjecture/src/main/kotlin/CollatzCalculator.kt new file mode 100644 index 0000000..3f76a99 --- /dev/null +++ b/kotlin/collatz-conjecture/src/main/kotlin/CollatzCalculator.kt @@ -0,0 +1,17 @@ +class CollatzCalculator { + companion object { + fun computeStepCount(inpInt: Int): Int{ + require(inpInt > 0) {"Only natural numbers are allowed"} + var temp = inpInt + var steps: Int = 0 + while (temp != 1){ + if (temp %2 == 0) { + temp /= 2 + } + else temp = temp*3 + 1 + steps++ + } + return steps + } + } +} \ No newline at end of file diff --git a/kotlin/collatz-conjecture/src/test/kotlin/CollatzCalculatorTest.kt b/kotlin/collatz-conjecture/src/test/kotlin/CollatzCalculatorTest.kt new file mode 100644 index 0000000..1937150 --- /dev/null +++ b/kotlin/collatz-conjecture/src/test/kotlin/CollatzCalculatorTest.kt @@ -0,0 +1,52 @@ +import org.junit.Ignore +import org.junit.Rule +import org.junit.Test +import org.junit.rules.ExpectedException +import kotlin.test.assertEquals + +/* + * version: 1.1.0 + */ +class CollatzCalculatorTest { + + @Rule + @JvmField + var expectedException: ExpectedException = ExpectedException.none() + + @Test + fun testZeroStepsRequiredWhenStartingFrom1() { + assertEquals(0, CollatzCalculator.computeStepCount(1)) + } + + @Test + fun testCorrectNumberOfStepsWhenAllStepsAreDivisions() { + assertEquals(4, CollatzCalculator.computeStepCount(16)) + } + + @Test + fun testCorrectNumberOfStepsWhenBothStepTypesAreNeeded() { + assertEquals(9, CollatzCalculator.computeStepCount(12)) + } + + @Test + fun testAVeryLargeInput() { + assertEquals(152, CollatzCalculator.computeStepCount(1000000)) + } + + @Test + fun testZeroIsConsideredInvalidInput() { + expectedException.expect(IllegalArgumentException::class.java) + expectedException.expectMessage("Only natural numbers are allowed") + + CollatzCalculator.computeStepCount(0) + } + + @Test + fun testNegativeIntegerIsConsideredInvalidInput() { + expectedException.expect(IllegalArgumentException::class.java) + expectedException.expectMessage("Only natural numbers are allowed") + + CollatzCalculator.computeStepCount(-15) + } + +} diff --git a/kotlin/grains/.gradle/3.5/file-changes/last-build.bin b/kotlin/grains/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/grains/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/grains/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..eb2fba896cd408eb15b5b5cce659dbbddae358d8 GIT binary patch literal 17 ScmZQRu^^kX(yPdZ0SW*s-2+ho literal 0 HcmV?d00001 diff --git a/kotlin/grains/.gradle/buildOutputCleanup/built.bin b/kotlin/grains/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/grains/.gradle/buildOutputCleanup/cache.properties b/kotlin/grains/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..ec941db --- /dev/null +++ b/kotlin/grains/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Tue Jul 18 17:57:08 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/grains/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/grains/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/grains/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/grains/.idea/compiler.xml b/kotlin/grains/.idea/compiler.xml new file mode 100644 index 0000000..aaf908b --- /dev/null +++ b/kotlin/grains/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/gradle.xml b/kotlin/grains/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/grains/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/grains/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..c4f27b9 --- /dev/null +++ b/kotlin/grains/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/grains/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..e29af23 --- /dev/null +++ b/kotlin/grains/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..8dc5a86 --- /dev/null +++ b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..caa2881 --- /dev/null +++ b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..6325d98 --- /dev/null +++ b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..1f91870 --- /dev/null +++ b/kotlin/grains/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/misc.xml b/kotlin/grains/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/grains/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/modules.xml b/kotlin/grains/.idea/modules.xml new file mode 100644 index 0000000..a4734df --- /dev/null +++ b/kotlin/grains/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/modules/grains_main.iml b/kotlin/grains/.idea/modules/grains_main.iml new file mode 100644 index 0000000..de01fe1 --- /dev/null +++ b/kotlin/grains/.idea/modules/grains_main.iml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/modules/grains_test.iml b/kotlin/grains/.idea/modules/grains_test.iml new file mode 100644 index 0000000..6da5426 --- /dev/null +++ b/kotlin/grains/.idea/modules/grains_test.iml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/grains/.idea/workspace.xml b/kotlin/grains/.idea/workspace.xml new file mode 100644 index 0000000..910c7dd --- /dev/null +++ b/kotlin/grains/.idea/workspace.xml @@ -0,0 +1,720 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @ignore + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1500321136890 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/src/test/kotlin/LuhnTest.kt + 29 + + + + file://$PROJECT_DIR$/src/test/kotlin/LuhnTest.kt + 36 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/luhn/README.md b/kotlin/luhn/README.md new file mode 100644 index 0000000..8f8c93b --- /dev/null +++ b/kotlin/luhn/README.md @@ -0,0 +1,73 @@ +# Luhn + +Given a number determine whether or not it is valid per the Luhn formula. + +The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is +a simple checksum formula used to validate a variety of identification +numbers, such as credit card numbers and Canadian Social Insurance +Numbers. + +The task is to check if a given string is valid. + +Validating a Number +------ + +Strings of length 1 or less are not valid. Spaces are allowed in the input, +but they should be stripped before checking. All other non-digit characters +are disallowed. + +## Example 1: valid credit card number + +``` +4539 1488 0343 6467 +``` + +The first step of the Luhn algorithm is to double every second digit, +starting from the right. We will be doubling + +``` +4_3_ 1_8_ 0_4_ 6_6_ +``` + +If doubling the number results in a number greater than 9 then subtract 9 +from the product. The results of our doubling: + +``` +8569 2478 0383 3437 +``` + +Then sum all of the digits: + +``` +8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80 +``` + +If the sum is evenly divisible by 10, then the number is valid. This number is valid! + +## Example 2: invalid credit card number + +``` +8273 1232 7352 0569 +``` + +Double the second digits, starting from the right + +``` +7253 2262 5312 0539 +``` + +Sum the digits + +``` +7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57 +``` + +57 is not evenly divisible by 10, so this number is not valid. + +## Source + +The Luhn Algorithm on Wikipedia [http://en.wikipedia.org/wiki/Luhn_algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/luhn/build.gradle b/kotlin/luhn/build.gradle new file mode 100644 index 0000000..0e6528d --- /dev/null +++ b/kotlin/luhn/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/luhn/build/classes/main/Luhn.class b/kotlin/luhn/build/classes/main/Luhn.class new file mode 100644 index 0000000000000000000000000000000000000000..ea1ce58e184175b54bbacf207b61e000ff02861d GIT binary patch literal 2614 zcmai0-ESLJ7XRJx*kezoi5u!RDU=4{E=`)&aiE4KrQ0-3Srf0}rsnCH_2@F^Q2P(_5vUqHZ~oM7HUH+oF$L0UizB+)B?B=+&Z?eL+z9p+lFf*EFIzd(;K8?IfE z*{Zx{H{DR+_0DMR>^vUranAK(2d|BCsDssZWuXuKCJx}>BZX>74Ll`~aHY2tE(^qt z4izmtjl(7mVSpLh$$U%wT+?x@(l_udtxh|h6P}5zn29Wom>9$#D5xyk{v;2kA1w|| zSvZOzw>14+*R=qlnL!}BKc zc!5alMnigRz^91hvCOm&Ghv~C7ZvuGl;SS9Iu*y2BAasm4!kKIcTT?1lwL&|c$pX- zwv!#!eSwM2+IA{V43*kFQmMNxuT0eRN~72|Cayo?tSa0j@4)|2HZaBXF55ww9T%14 zx`k<6FmWEQ5Rpf=avq6TlOkSKq8Sz`l(h!ix5&p4&>WfzI#Q-aWJZLQ^<_mmYtoOleH}S|4XV zwIvbgeN3BbLJB<7A=q_7P)`q+oq)(oYG_TE&{d}I%H0?zn@hwCH4aFV z0EyaAM>w&{I_XpOD$n0rs#k1x-u4}P(Un)#!u*vSPqwnr=IogZ?aJz`-DvN#SDIev z)OeZJoWP;c!%;Z7GlyBZxq8#D$P140y05i4FBh9j)3-y(XU0lxS`ptObBaDt@^!qrrf!w&!Z*1UXe7TS~o=K!rpQ1~>s_Ten z68CZH+B&+Ax3ur$^fl$@W2D~I#roFQ$2W0iT#psv{rU#ZjVJnP@TU(ktlp)9k%?!F zLb70Gk}6KBKgBqOJsB&r=Vl?kzV%Zko;Hca(AS~I?#;&T@z@Fcz`qoa9q^d%@@sJw z`!S0$B`;zI7fI>32Md>QnV%0uT_MlJr<{ayRp; z$6xRoBRqkB;W}sS=v}8>oUsggN)l5FXQ_9I z&sBP_5%F#E-$M^$?jx2Ak?kkW9&GUWH}~K18}mKsA6UR9eZK?iR~#~M=r{Bm7!+a) zBS;$1$cp~S5+uN7aEpL;lTmq4{DOpOZPB&SX>H&PEzbidy3W!!+o&Z~{!&;YgSUq_ zMM>0`i8OnSb6#-)Yxn_f4sSyH3Y9M+9aS2uC2J>3r6>_`hz`|DkZU1tPO^s6+&9=OlO4~U0rsay^Aw> z^KWTi`qGE?q3!e`Sjj?W3In_6UhaO*_ndpqg@6A2`#pdpeqadZ>nBEu z3p)VDFnX$9s4-nNj$^w=r@TV5eGJn=Gmdq>r5$T_(Y9zHvZ`U2_9ic@x>jZAo1H7u z(|OZ6j-A#G&5lWAhM`~L0|=6%T%lOnC}h88@aN@hCX5gU2QYvz14{%k%n;B-lX!bJ zf1|~5nwdKYV-%4PJu=2Hac0`OX2fjr6x$GjTefBz;w5Rm#W1cmX0}yb@R=%qtJZa! zVQ%)I6Ps(Ba-z=6mBaW1cS5+02@1kK(F8-NA-fsaxRa9uZkaieGcKGwuy_zt46{P3 zo$F3=in&7RM78&MP1Ou1y4>4+e!(rlW#;0kbP!R7F-LI8s=Io__{`DpIju{li2aaZ zzLUMlD`t(iRJ79-37=(9(y1WkX@?p*Y4g;orWz!TVKAObMVFVCqscW|vq(ZTCz_9~ zS_vY~5NWNlcvZ8rsztGkuO(NPqKV{EGP=5yN=D`7Cu-I_hES)!+eNr%uMm6P( zie9hssuO{m#xQA8Z$zyy#Jz;Qx>2#~s@(FAKxANx6xd=Tur$Mhmr;CIJ2G|3TUQao z^!)YDQpJpun`aF7Z+2aVQ9M^GylwlHDDBag43jm};U*KJZ> zG~>K(H!_jViL7Z^)N=Z}tZ7hr*t}XYck8yhLKaJ!`b2inGmV;TJ&bSQ51}6~XhZVN zet5-gwW``Gb)QnZ=%Yqw^5UoAQDX>dw=)`56AZszUET^Q6G})Ky}Ar3L21w@I5cr} znN;Fz(|7%opQd(#qkVUkc>jw4Sw7eDyH>!pg03~-S|QgObgi&!4Y}5^YmKt_xI9hNWeUSgBE%b~xhLN@yocuo|^dk>8)*YK@VLKFeVxJIp!Gle9$1eAPO%OKe z!KS)nS9`#&5_ZjlUF(khq6h4A!mfL;neN!iv7o<> U@Co|a#Ja$OKuTauAS3YlKf)) + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/luhn/out/production/classes/Luhn.class b/kotlin/luhn/out/production/classes/Luhn.class new file mode 100644 index 0000000000000000000000000000000000000000..2f5df8ce3d0e4c64996f701d68c30328b90a0f71 GIT binary patch literal 2958 zcmai0-E$jP760AUN-M2pTXCYqDs`h`LH!lm5?Ca1D0Nh)xRISuI}S-8&RV*$*OpeQ zc4ZR28laT+0p80?XDEYt2s5+{j;EOcPnm%k9(dx3H-;I8KcEc541@XIl^o01fw6b* zx#ynG-#PcJe*fS;W7RPr1Y&E}hBa2UoRzW5%WJae83+g%w!3JR?UF!z zps+77@6~N*WpeO_K!2fHUm07I-g4ct9e2!foT_Jec9ry8)thUS%aa19_jTtQm1SAK zSgltqZ~AUg)|9M)ut3CiYE8>wm;%qNSG}_BjIC`{#%#xvb;l}?%{a=nYZqMuQGrv% zRasoWV%4pRq{NKdaw+g!d%VqzCXdKqF^Vp9o9IMLKqSNH5kMFxm~hLzC+~V=&9K}{ zMCGJFcU{)XR#B!(@{ZLgdjhxGy|vIe?Cmh;#!MTp73E+Xt7R&RUL;JM!czwd)jT!u zv_PmVofU6YATTgE6U8$)ZK4lJf!uJIVhaimS?$gp+xBWj*rXxQbF ztQ+{WkD?!b*2Dxp!%U0JeTs$F2WAHIQJh0g;mgi8Hmq_(UcRG1$RFwQvv^*~eoo-n zzDxG8Tv5)Z7jIPiqYkZxDpt#7jtT#wtAfn5l<9j8msLTo@ZSF)VFRxa!d1(i z<1O=HzY)a(u9}#~A|rChR>u7!;{HWkS4W&Xx+g0&URfq6Yyr)ty2uMeQ+CQqrBiOB za^aqUDa*1V9WP~X5IZt`BATkpqO{p{{n>Q%Hel+eD9?iqzD-Roi9c1vRKARqL`F!!vX93sZCX=_qP&BGB+E zndgg~mi~1-R%pRKD?O`Zc@_<6m5l(WzEH0ax6A$(1Z|zWQd;1po%_9})~lIXZ0EkI zg%#0ZDl*o^CH$K=wBDWj8Esr#Fv8l0KMH9v?d7gm;3;if&xB$@uAvWq8ZwkQ-mgfR z5ieEvQ7{=Gqc&6uqwDGt<*Oy;-&3d-t@5H(x2@%}Tu?7URj?h|M5D#&ocFBa`m9xJ z?NhHb9M7)s!fe>CO{K@3!j>Mgo*19aW7)+}Og)*EZ3e(3|pGn7yV< zy@SZ>L9w~}enO|;TriLgC4$@dLe5A~<=WdAQtQoZI39|Jvyp6PJfd8g36rj}UGdI% z*X?X*bN7$&P|U3T5Qe@9J@8;Q@PNRC@Dcwa1m@cW;s^YYy1eyY!k1y-Du=)=QbGIy zQ7qv$9H-?z?#}Va(Q}>=U8U?2F@i@ z;cfDNf*7NSGrE(E^%NtI;ZJ=2!u?;_5Pu{65qj`CeLO(tztCr(Z9Y^Q zXQyC1X8VT|{Jn);j3RP~uQZg}#4b~K!ZAHeh<_r~5#41R;s3H>V3_*zz-Y${VwV9@ zT*aiUM(|xSctd#`)d@e)S<>uhe`QpN4n0J5Xb0LaP=C*tQN@i?O1+yPD`-PLhhvAp z?b$f(^XT9aw1;?2sW zT&-kel1t4Q>T;BrtvPq_H`>zDp2#K794eUU{`5#@JeM}pDkZU1tPO^s6+&9=OlO4~U0rsay^Aw> z^KWTi`qGE?q3!e`Sjj?W3In_6UhaO*_ndpqg@6A2`#pdpeqadZ>nBEu z3p)VDFnX$9s4-nNj$^w=r@TV5eGJn=Gmdq>r5$T_(Y9zHvZ`U2_9ic@x>jZAo1H7u z(|OZ6j-A#G&5lWAhM`~L0|=6%T%lOnC}h88@aN@hCX5gU2QYvz14{%k%n;B-lX!bJ zf1|~5nwdKYV-%4PJu=2Hac0`OX2fjr6x$GjTefBz;w5Rm#W1cmX0}yb@R=%qtJZa! zVQ%)I6Ps(Ba-z=6mBaW1cS5+02@1kK(F8-NA-fsaxRa9uZkaieGcKGwuy_zt46{P3 zo$F3=in&7RM78&MP1Ou1y4>4+e!(rlW#;0kbP!R7F-LI8s=Io__{`DpIju{li2aaZ zzLUMlD`t(iRJ79-37=(9(y1WkX@?p*Y4g;orWz!TVKAObMVFVCqscW|vq(ZTCz_9~ zS_vY~5NWNlcvZ8rsztGkuO(NPqKV{EGP=5yN=D`7Cu-I_hES)!+eNr%uMm6P( zie9hssuO{m#xQA8Z$zyy#Jz;Qx>2#~s@(FAKxANx6xd=Tur$Mhmr;CIJ2G|3TUQao z^!)YDQpJpun`aF7Z+2aVQ9M^GylwlHDDBag43jm};U*KJZ> zG~>K(H!_jViL7Z^)N=Z}tZ7hr*t}XYck8yhLKaJ!`b2inGmV;TJ&bSQ51}6~XhZVN zet5-gwW``Gb)QnZ=%Yqw^5UoAQDX>dw=)`56AZszUET^Q6G})Ky}Ar3L21w@I5cr} znN;Fz(|7%opQd(#qkVUkc>jw4Sw7eDyH>!pg03~-S|QgObgi&!4Y}5^YmKt_xI9hNWeUSgBE%b~xhLN@yocuo|^dk>8)*YK@VLKFeVxJIp!Gle9$1eAPO%OKe z!KS)nS9`#&5_ZjlUF(khq6h4A!mfL;neN!iv7o<> U@Co|a#Ja$OKuTauAS3YlKf)) 9){ temp - 9 } else {temp}) + } + else {build.append(reversed[i])} + } + return (build.sumBy { it.toString().toInt() } % 10 ==0) + } + catch (e: NumberFormatException){ return false } + } +} \ No newline at end of file diff --git a/kotlin/luhn/src/test/kotlin/LuhnTest.kt b/kotlin/luhn/src/test/kotlin/LuhnTest.kt new file mode 100644 index 0000000..83add8f --- /dev/null +++ b/kotlin/luhn/src/test/kotlin/LuhnTest.kt @@ -0,0 +1,88 @@ +import org.junit.Test +import org.junit.Ignore +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class LuhnTest { + + + @Test + fun singleDigitStringsCannotBeValid() { + assertFalse(Luhn.isValid("1")) + } + + + @Test + fun singleZeroIsInvalid() { + assertFalse(Luhn.isValid("0")) + } + + + @Test + fun simpleValidSINThatRemainsValidIfReversed() { + assertTrue(Luhn.isValid("059")) + assertTrue(Luhn.isValid("950")) + } + + + @Test + fun simpleValidSINThatBecomesInvalidIfReversed() { + assertTrue(Luhn.isValid("59")) + assertFalse(Luhn.isValid("95")) + } + + + @Test + fun validCanadianSIN() { + assertTrue(Luhn.isValid("055 444 285")) + } + + + @Test + fun invalidCanadianSIN() { + assertFalse(Luhn.isValid("055 444 286")) + } + + + @Test + fun invalidCreditCard() { + assertFalse(Luhn.isValid("8273 1232 7352 0569")) + } + + + @Test + fun validStringsWithNonDigitIncludedBecomeInvalid() { + assertFalse(Luhn.isValid("055a 444 285")) + } + + + @Test + fun validStringsWithPunctuationIncludedBecomeInvalid() { + assertFalse(Luhn.isValid("055-444-285")) + } + + + @Test + fun validStringsWithSymbolsIncludedBecomeInvalid() { + assertFalse(Luhn.isValid("055£ 444$ 285")) + } + + + @Test + fun singleZeroWithSpaceIsInvalid() { + assertFalse(Luhn.isValid(" 0")) + } + + + @Test + fun moreThanSingleZeroIsValid() { + assertTrue(Luhn.isValid("0000 0")) + } + + + @Test + fun inputDigit9IsCorrectlyConvertedToOutputDigit9() { + assertTrue(Luhn.isValid("091")) + } + +} diff --git a/kotlin/nth-prime/.gradle/3.5/file-changes/last-build.bin b/kotlin/nth-prime/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/nth-prime/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/nth-prime/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..5a74852614ced94f9dc0f6dbb029af14ce6190a3 GIT binary patch literal 17 TcmZRc#FDKSz2e_d1}FdkE+qr` literal 0 HcmV?d00001 diff --git a/kotlin/nth-prime/.gradle/buildOutputCleanup/built.bin b/kotlin/nth-prime/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties b/kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..44c833f --- /dev/null +++ b/kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Jul 19 19:34:35 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/nth-prime/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/compiler.xml b/kotlin/nth-prime/.idea/compiler.xml new file mode 100644 index 0000000..20a1152 --- /dev/null +++ b/kotlin/nth-prime/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/gradle.xml b/kotlin/nth-prime/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/nth-prime/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/nth-prime/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..c4f27b9 --- /dev/null +++ b/kotlin/nth-prime/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/nth-prime/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..e29af23 --- /dev/null +++ b/kotlin/nth-prime/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..8dc5a86 --- /dev/null +++ b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..caa2881 --- /dev/null +++ b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..6325d98 --- /dev/null +++ b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..1f91870 --- /dev/null +++ b/kotlin/nth-prime/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/misc.xml b/kotlin/nth-prime/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/nth-prime/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/modules.xml b/kotlin/nth-prime/.idea/modules.xml new file mode 100644 index 0000000..ef0f00f --- /dev/null +++ b/kotlin/nth-prime/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/modules/nth-prime_main.iml b/kotlin/nth-prime/.idea/modules/nth-prime_main.iml new file mode 100644 index 0000000..cc05efa --- /dev/null +++ b/kotlin/nth-prime/.idea/modules/nth-prime_main.iml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/modules/nth-prime_test.iml b/kotlin/nth-prime/.idea/modules/nth-prime_test.iml new file mode 100644 index 0000000..8762861 --- /dev/null +++ b/kotlin/nth-prime/.idea/modules/nth-prime_test.iml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/nth-prime/.idea/workspace.xml b/kotlin/nth-prime/.idea/workspace.xml new file mode 100644 index 0000000..3940738 --- /dev/null +++ b/kotlin/nth-prime/.idea/workspace.xml @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Ignore\n + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Generated by +Gradle 3.5 at Jul 16, 2017 11:25:57 AM

+ + + + diff --git a/kotlin/raindrops/build/reports/tests/test/css/base-style.css b/kotlin/raindrops/build/reports/tests/test/css/base-style.css new file mode 100644 index 0000000..4afa73e --- /dev/null +++ b/kotlin/raindrops/build/reports/tests/test/css/base-style.css @@ -0,0 +1,179 @@ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 12pt; +} + +body, a, a:visited { + color: #303030; +} + +#content { + padding-left: 50px; + padding-right: 50px; + padding-top: 30px; + padding-bottom: 30px; +} + +#content h1 { + font-size: 160%; + margin-bottom: 10px; +} + +#footer { + margin-top: 100px; + font-size: 80%; + white-space: nowrap; +} + +#footer, #footer a { + color: #a0a0a0; +} + +#line-wrapping-toggle { + vertical-align: middle; +} + +#label-for-line-wrapping-toggle { + vertical-align: middle; +} + +ul { + margin-left: 0; +} + +h1, h2, h3 { + white-space: nowrap; +} + +h2 { + font-size: 120%; +} + +ul.tabLinks { + padding-left: 0; + padding-top: 10px; + padding-bottom: 10px; + overflow: auto; + min-width: 800px; + width: auto !important; + width: 800px; +} + +ul.tabLinks li { + float: left; + height: 100%; + list-style: none; + padding-left: 10px; + padding-right: 10px; + padding-top: 5px; + padding-bottom: 5px; + margin-bottom: 0; + -moz-border-radius: 7px; + border-radius: 7px; + margin-right: 25px; + border: solid 1px #d4d4d4; + background-color: #f0f0f0; +} + +ul.tabLinks li:hover { + background-color: #fafafa; +} + +ul.tabLinks li.selected { + background-color: #c5f0f5; + border-color: #c5f0f5; +} + +ul.tabLinks a { + font-size: 120%; + display: block; + outline: none; + text-decoration: none; + margin: 0; + padding: 0; +} + +ul.tabLinks li h2 { + margin: 0; + padding: 0; +} + +div.tab { +} + +div.selected { + display: block; +} + +div.deselected { + display: none; +} + +div.tab table { + min-width: 350px; + width: auto !important; + width: 350px; + border-collapse: collapse; +} + +div.tab th, div.tab table { + border-bottom: solid #d0d0d0 1px; +} + +div.tab th { + text-align: left; + white-space: nowrap; + padding-left: 6em; +} + +div.tab th:first-child { + padding-left: 0; +} + +div.tab td { + white-space: nowrap; + padding-left: 6em; + padding-top: 5px; + padding-bottom: 5px; +} + +div.tab td:first-child { + padding-left: 0; +} + +div.tab td.numeric, div.tab th.numeric { + text-align: right; +} + +span.code { + display: inline-block; + margin-top: 0em; + margin-bottom: 1em; +} + +span.code pre { + font-size: 11pt; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + margin: 0; + background-color: #f7f7f7; + border: solid 1px #d0d0d0; + min-width: 700px; + width: auto !important; + width: 700px; +} + +span.wrapped pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: break-all; +} + +label.hidden { + display: none; +} \ No newline at end of file diff --git a/kotlin/raindrops/build/reports/tests/test/css/style.css b/kotlin/raindrops/build/reports/tests/test/css/style.css new file mode 100644 index 0000000..3dc4913 --- /dev/null +++ b/kotlin/raindrops/build/reports/tests/test/css/style.css @@ -0,0 +1,84 @@ + +#summary { + margin-top: 30px; + margin-bottom: 40px; +} + +#summary table { + border-collapse: collapse; +} + +#summary td { + vertical-align: top; +} + +.breadcrumbs, .breadcrumbs a { + color: #606060; +} + +.infoBox { + width: 110px; + padding-top: 15px; + padding-bottom: 15px; + text-align: center; +} + +.infoBox p { + margin: 0; +} + +.counter, .percent { + font-size: 120%; + font-weight: bold; + margin-bottom: 8px; +} + +#duration { + width: 125px; +} + +#successRate, .summaryGroup { + border: solid 2px #d0d0d0; + -moz-border-radius: 10px; + border-radius: 10px; +} + +#successRate { + width: 140px; + margin-left: 35px; +} + +#successRate .percent { + font-size: 180%; +} + +.success, .success a { + color: #008000; +} + +div.success, #successRate.success { + background-color: #bbd9bb; + border-color: #008000; +} + +.failures, .failures a { + color: #b60808; +} + +.skipped, .skipped a { + color: #c09853; +} + +div.failures, #successRate.failures { + background-color: #ecdada; + border-color: #b60808; +} + +ul.linkList { + padding-left: 0; +} + +ul.linkList li { + list-style: none; + margin-bottom: 5px; +} diff --git a/kotlin/raindrops/build/reports/tests/test/index.html b/kotlin/raindrops/build/reports/tests/test/index.html new file mode 100644 index 0000000..1fcdf24 --- /dev/null +++ b/kotlin/raindrops/build/reports/tests/test/index.html @@ -0,0 +1,132 @@ + + + + + +Test results - Test Summary + + + + + +
+

Test Summary

+
+ + + + + +
+
+ + + + + + + +
+
+
16
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.015s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Packages

+ + + + + + + + + + + + + + + + + + + + + +
PackageTestsFailuresIgnoredDurationSuccess rate
+default-package +16000.015s100%
+
+
+

Classes

+ + + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+RaindropsTest +16000.015s100%
+
+
+ +
+ + diff --git a/kotlin/raindrops/build/reports/tests/test/js/report.js b/kotlin/raindrops/build/reports/tests/test/js/report.js new file mode 100644 index 0000000..83bab4a --- /dev/null +++ b/kotlin/raindrops/build/reports/tests/test/js/report.js @@ -0,0 +1,194 @@ +(function (window, document) { + "use strict"; + + var tabs = {}; + + function changeElementClass(element, classValue) { + if (element.getAttribute("className")) { + element.setAttribute("className", classValue); + } else { + element.setAttribute("class", classValue); + } + } + + function getClassAttribute(element) { + if (element.getAttribute("className")) { + return element.getAttribute("className"); + } else { + return element.getAttribute("class"); + } + } + + function addClass(element, classValue) { + changeElementClass(element, getClassAttribute(element) + " " + classValue); + } + + function removeClass(element, classValue) { + changeElementClass(element, getClassAttribute(element).replace(classValue, "")); + } + + function initTabs() { + var container = document.getElementById("tabs"); + + tabs.tabs = findTabs(container); + tabs.titles = findTitles(tabs.tabs); + tabs.headers = findHeaders(container); + tabs.select = select; + tabs.deselectAll = deselectAll; + tabs.select(0); + + return true; + } + + function getCheckBox() { + return document.getElementById("line-wrapping-toggle"); + } + + function getLabelForCheckBox() { + return document.getElementById("label-for-line-wrapping-toggle"); + } + + function findCodeBlocks() { + var spans = document.getElementById("tabs").getElementsByTagName("span"); + var codeBlocks = []; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].className.indexOf("code") >= 0) { + codeBlocks.push(spans[i]); + } + } + return codeBlocks; + } + + function forAllCodeBlocks(operation) { + var codeBlocks = findCodeBlocks(); + + for (var i = 0; i < codeBlocks.length; ++i) { + operation(codeBlocks[i], "wrapped"); + } + } + + function toggleLineWrapping() { + var checkBox = getCheckBox(); + + if (checkBox.checked) { + forAllCodeBlocks(addClass); + } else { + forAllCodeBlocks(removeClass); + } + } + + function initControls() { + if (findCodeBlocks().length > 0) { + var checkBox = getCheckBox(); + var label = getLabelForCheckBox(); + + checkBox.onclick = toggleLineWrapping; + checkBox.checked = false; + + removeClass(label, "hidden"); + } + } + + function switchTab() { + var id = this.id.substr(1); + + for (var i = 0; i < tabs.tabs.length; i++) { + if (tabs.tabs[i].id === id) { + tabs.select(i); + break; + } + } + + return false; + } + + function select(i) { + this.deselectAll(); + + changeElementClass(this.tabs[i], "tab selected"); + changeElementClass(this.headers[i], "selected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var h2 = document.createElement("H2"); + + h2.appendChild(document.createTextNode(this.titles[i])); + this.headers[i].appendChild(h2); + } + + function deselectAll() { + for (var i = 0; i < this.tabs.length; i++) { + changeElementClass(this.tabs[i], "tab deselected"); + changeElementClass(this.headers[i], "deselected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var a = document.createElement("A"); + + a.setAttribute("id", "ltab" + i); + a.setAttribute("href", "#tab" + i); + a.onclick = switchTab; + a.appendChild(document.createTextNode(this.titles[i])); + + this.headers[i].appendChild(a); + } + } + + function findTabs(container) { + return findChildElements(container, "DIV", "tab"); + } + + function findHeaders(container) { + var owner = findChildElements(container, "UL", "tabLinks"); + return findChildElements(owner[0], "LI", null); + } + + function findTitles(tabs) { + var titles = []; + + for (var i = 0; i < tabs.length; i++) { + var tab = tabs[i]; + var header = findChildElements(tab, "H2", null)[0]; + + header.parentNode.removeChild(header); + + if (header.innerText) { + titles.push(header.innerText); + } else { + titles.push(header.textContent); + } + } + + return titles; + } + + function findChildElements(container, name, targetClass) { + var elements = []; + var children = container.childNodes; + + for (var i = 0; i < children.length; i++) { + var child = children.item(i); + + if (child.nodeType === 1 && child.nodeName === name) { + if (targetClass && child.className.indexOf(targetClass) < 0) { + continue; + } + + elements.push(child); + } + } + + return elements; + } + + // Entry point. + + window.onload = function() { + initTabs(); + initControls(); + }; +} (window, window.document)); \ No newline at end of file diff --git a/kotlin/raindrops/build/reports/tests/test/packages/default-package.html b/kotlin/raindrops/build/reports/tests/test/packages/default-package.html new file mode 100644 index 0000000..8af8a05 --- /dev/null +++ b/kotlin/raindrops/build/reports/tests/test/packages/default-package.html @@ -0,0 +1,103 @@ + + + + + +Test results - Default package + + + + + +
+

Default package

+ +
+ + + + + +
+
+ + + + + + + +
+
+
16
+

tests

+
+
+
+
0
+

failures

+
+
+
+
0
+

ignored

+
+
+
+
0.015s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Classes

+ + + + + + + + + + + + + + + + + + + +
ClassTestsFailuresIgnoredDurationSuccess rate
+RaindropsTest +16000.015s100%
+
+
+ +
+ + diff --git a/kotlin/raindrops/build/test-results/test/TEST-RaindropsTest.xml b/kotlin/raindrops/build/test-results/test/TEST-RaindropsTest.xml new file mode 100644 index 0000000..bc15548 --- /dev/null +++ b/kotlin/raindrops/build/test-results/test/TEST-RaindropsTest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/kotlin/raindrops/build/test-results/test/binary/output.bin b/kotlin/raindrops/build/test-results/test/binary/output.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/raindrops/build/test-results/test/binary/output.bin.idx b/kotlin/raindrops/build/test-results/test/binary/output.bin.idx new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/raindrops/build/test-results/test/binary/results.bin b/kotlin/raindrops/build/test-results/test/binary/results.bin new file mode 100644 index 0000000000000000000000000000000000000000..b84fe524667428348f2c40522e123f6c2f757e60 GIT binary patch literal 705 zcmZwE%}&BV5C`yCDj+I|Z{X1;9=h9>ucU9l!5D9*2NI2GVu}Htg99f+fP`@3!nJ%I zd^Eeevu0LkPtE>1J2QWW6~@oKBz+t7zlJaG!w~?ByKJ(lv+q&<`RaA<2j={NyAh9} zf+hoJstl(l6mArX81hF|%HU$Dl%R@>M=oSJk-rodXA1ii`)>5~nWP`om9z_}Yn-?( zl(h?~YoBqK+BK*PrR&Li84k09%3Sr=q>g)k&`iC9D-Bx|iqndFxYjqfDQwDueLC?T zZWemkb|S$USw(5(5~!)Ing^(@bWJ-O)n&eK9Nx@yfLr8NIxoB#j- literal 0 HcmV?d00001 diff --git a/kotlin/raindrops/raindrops.iml b/kotlin/raindrops/raindrops.iml new file mode 100644 index 0000000..57fe70f --- /dev/null +++ b/kotlin/raindrops/raindrops.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/raindrops/src/main/kotlin/.keep b/kotlin/raindrops/src/main/kotlin/.keep new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/raindrops/src/main/kotlin/Raindrops.kt b/kotlin/raindrops/src/main/kotlin/Raindrops.kt new file mode 100644 index 0000000..29aead9 --- /dev/null +++ b/kotlin/raindrops/src/main/kotlin/Raindrops.kt @@ -0,0 +1,14 @@ +object Raindrops { + fun convert(inp: Int): String = + when { + ((inp % 3 == 0) and (inp % 5 == 0) and (inp % 7 == 0)) -> "PlingPlangPlong" + ((inp % 3 == 0) and (inp % 5 == 0)) -> "PlingPlang" + ((inp % 3 == 0) and (inp % 7 == 0)) -> "PlingPlong" + ((inp % 5 == 0) and (inp % 7 == 0)) -> "PlangPlong" + ((inp % 3 == 0)) -> "Pling" + ((inp % 5 == 0)) -> "Plang" + ((inp % 7 == 0)) -> "Plong" + else -> inp.toString() + } + +} \ No newline at end of file diff --git a/kotlin/raindrops/src/test/kotlin/RaindropsTest.kt b/kotlin/raindrops/src/test/kotlin/RaindropsTest.kt new file mode 100644 index 0000000..3363811 --- /dev/null +++ b/kotlin/raindrops/src/test/kotlin/RaindropsTest.kt @@ -0,0 +1,47 @@ +import org.junit.Test +import org.junit.Ignore +import org.junit.runner.RunWith +import org.junit.runners.Parameterized +import kotlin.test.assertEquals + +@RunWith(Parameterized::class) +class RaindropsTest(val input: Int, val expectedOutput: String) { + + companion object { + @JvmStatic + @Parameterized.Parameters(name = "{index}: raindrops({0})={1}") + fun data() = listOf( + // Non-primes + arrayOf(1, "1"), + arrayOf(52, "52"), + arrayOf(12121, "12121"), + + // Numbers with 3 as a prime factor + arrayOf(3, "Pling"), + arrayOf(6, "Pling"), + arrayOf(9, "Pling"), + + // Numbers with 5 as a prime factor + arrayOf(5, "Plang"), + arrayOf(10, "Plang"), + arrayOf(25, "Plang"), + + // Numbers with 7 as a prime factor + arrayOf(7, "Plong"), + arrayOf(14, "Plong"), + arrayOf(49, "Plong"), + + // Numbers with multiple activating prime factors + arrayOf(15, "PlingPlang"), + arrayOf(21, "PlingPlong"), + arrayOf(35, "PlangPlong"), + arrayOf(105, "PlingPlangPlong") + ) + } + + + @Test + fun test() { + assertEquals(expectedOutput, Raindrops.convert(input)) + } +} diff --git a/kotlin/saddle-points/.gradle/3.5/file-changes/last-build.bin b/kotlin/saddle-points/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/saddle-points/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/saddle-points/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..6015c3b69dbf74de2cf42b112660cc80c5cb74f4 GIT binary patch literal 17 ScmZS1ZGYzH8 + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/gradle.xml b/kotlin/saddle-points/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/saddle-points/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/saddle-points/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..c4f27b9 --- /dev/null +++ b/kotlin/saddle-points/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/saddle-points/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..e29af23 --- /dev/null +++ b/kotlin/saddle-points/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..8dc5a86 --- /dev/null +++ b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..caa2881 --- /dev/null +++ b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..6325d98 --- /dev/null +++ b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..1f91870 --- /dev/null +++ b/kotlin/saddle-points/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/misc.xml b/kotlin/saddle-points/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/saddle-points/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/modules.xml b/kotlin/saddle-points/.idea/modules.xml new file mode 100644 index 0000000..fcd7836 --- /dev/null +++ b/kotlin/saddle-points/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/modules/saddle-points_main.iml b/kotlin/saddle-points/.idea/modules/saddle-points_main.iml new file mode 100644 index 0000000..d75a92f --- /dev/null +++ b/kotlin/saddle-points/.idea/modules/saddle-points_main.iml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/modules/saddle-points_test.iml b/kotlin/saddle-points/.idea/modules/saddle-points_test.iml new file mode 100644 index 0000000..fcdfdc8 --- /dev/null +++ b/kotlin/saddle-points/.idea/modules/saddle-points_test.iml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/saddle-points/.idea/workspace.xml b/kotlin/saddle-points/.idea/workspace.xml new file mode 100644 index 0000000..5699988 --- /dev/null +++ b/kotlin/saddle-points/.idea/workspace.xml @@ -0,0 +1,693 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1500415477058 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/kotlin/sieve/README.md b/kotlin/sieve/README.md new file mode 100644 index 0000000..60eb161 --- /dev/null +++ b/kotlin/sieve/README.md @@ -0,0 +1,36 @@ +# Sieve + +Use the Sieve of Eratosthenes to find all the primes from 2 up to a given +number. + +The Sieve of Eratosthenes is a simple, ancient algorithm for finding all +prime numbers up to any given limit. It does so by iteratively marking as +composite (i.e. not prime) the multiples of each prime, +starting with the multiples of 2. + +Create your range, starting at two and continuing up to and including the given limit. (i.e. [2, limit]) + +The algorithm consists of repeating the following over and over: + +- take the next available unmarked number in your list (it is prime) +- mark all the multiples of that number (they are not prime) + +Repeat until you have processed each number in your range. + +When the algorithm terminates, all the numbers in the list that have not +been marked are prime. + +The wikipedia article has a useful graphic that explains the algorithm: +https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes + +Notice that this is a very specific algorithm, and the tests don't check +that you've implemented the algorithm, only that you've come up with the +correct list of primes. + +## Source + +Sieve of Eratosthenes at Wikipedia [http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/sieve/build.gradle b/kotlin/sieve/build.gradle new file mode 100644 index 0000000..0e6528d --- /dev/null +++ b/kotlin/sieve/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/sieve/build/kotlin-build/caches/version.txt b/kotlin/sieve/build/kotlin-build/caches/version.txt new file mode 100644 index 0000000..01aabac --- /dev/null +++ b/kotlin/sieve/build/kotlin-build/caches/version.txt @@ -0,0 +1 @@ +11001 \ No newline at end of file diff --git a/kotlin/sieve/out/production/classes/Sieve.class b/kotlin/sieve/out/production/classes/Sieve.class new file mode 100644 index 0000000000000000000000000000000000000000..f6f7896663ab9e2ad0c88521b96321a795d99edc GIT binary patch literal 2118 zcmaJ?-BTM?6#w1LZZ=uAB~XGCnwDC%fd&H9MlF;I1vDk3l~5{0Z8u~a7Q!yw-7wXs z&eYL2#~I(PwGZ{h869W%urp4kzB&B^{0DsLIKHYc#dB{Gpo7zy-M#0YuY1n#oOAcL zXFvY}U;wuml$>R*nJO4VWXV`Fk|o0~CNJfe%mrUXfI(YztrgR|vO4219EzvAGD5BF zTcu>i^87)D6B)-XCYMYlEtg89b!gXa#C462xv`26LvYBl zEq|CH5bv7Rp`k%T7&^njU5l#nL58N?AV(diWE!@L2!pz2l*;C%n+&b-YqbzXCN-r& z9nCnTp$RQ?j!`HuMB~*=_9Q&mbxlVrUTQ!i+Un;E`IO-=s%U4By<4tNOMI+rOve$# zG<4u7`7D~mj_%;I*Q<_B9Oph?X3+E1sAqY+B4s-A6}-wrdyS%BcKniMCta$7=_S*) zKg}r>aVk|jovs4Zt)UC27>?}IzU(?h*YrHXUPaG7f5MqJNw_C@D!#eOa6X=Sk()uP z_zUGa`Z1uP52qPIgu;a7dISX(Gp*wcQW|>k233ee8N>5+yjA6$t@3gdgpQ#q?;P2A z9LSUL^#4?6KTF4Xyv?B<;rUpfm^v;X#TjGI^$G!L7EM>h1n-b~6N@6%M5069)$k6| z49udJuS*OKuIZOuTl6dq$^P~a^ODxYvcG6~lvqZL6?HwktwH9^97<<%Gb7mx<2tTj zIt&T3#2i|nYK!J?s-rw*`bNR<4KkKi)&exBjDLc(&5JF_>oV;M{S1?pJ8hcOCTUWn zaz~Rwoam%C#OctlpGj?%I|EW58&yNn<8OmfM7r1#3ABfr5~V7kzhMfkG~75 z+~okHMLw>jf17^PXmwTyhpoZ%ma#*Af~+44%> zbZeXgIp0`Vo-$Tz`*6-G+6Dni+VP!2?A#_pdrDj{%rGI*FSoN$my6@KebeT{z;L+cVRoNA^{+%V;)x&TwIM1%)2JXwYmwMb zNg5*VzmE`}+rWVe8m9uo9Vs~$l^>uzA#WnOg~JlA65}4ip9a{&?LU>_j?Xu7?2DS3 zmxyiQgoFy3)^Sq)2D6XQH5ZF5c5EO~L2qmmug}e`FL*U${yKjmp1?R9*<2^xKP%<_# zf-EkPUIYHZWuhbwBHj}ab1Fx+3>I-G2yhO&CbVTbL&0%^y@$>_M}LDXN$!%LFKN9` zyzddg2EChP_k^zYr?mb}aV?RTL1@p=s-lsx*2Zm&BBVlMV$bL|Cov}dgIL2hjv`o- z2q6&Du}lsmlqekRlj0Adb>}+k)P#1bv%hmk zK@eJZM(aP(pE!NyY`@k$u3?otakS?M*=zF%q%kj^5Ab1q_YpC0oqul3gLyEJpGU~U Rw1))`4IUIh5S{Z-_zxc))kFXQ literal 0 HcmV?d00001 diff --git a/kotlin/sieve/out/test/classes/SieveTest.class b/kotlin/sieve/out/test/classes/SieveTest.class new file mode 100644 index 0000000000000000000000000000000000000000..4f8b099ce1d375977b69385a8a3591a5cef008a4 GIT binary patch literal 3143 zcmai$Z*W~j8OGmtH}~9|o3!1hN!z4t+R`>OY1-Z-Z73yeAq{N_y);15K#W*#lGAXS zn|qUc&J8FkEr=+HhzOPPA4HK3!yqFqI6!5FVbpOP#}9sT{NQxd@dM*Hj^j8w?z!)# zjcpw>xo3a-oIShmzR&L2^Rs`y`#uqM(jKPjfxw^j2mLTg5;K{jx!GJMpDRpc`bUrY zV^-Bn3y%ba@qIxljBYLkQ$CY!X&thSv&GUx=4iPPM47mUZYErKzONAZ6MiX4DW>FX zE?@Thk1#E5>1)ki(x|(Z(o~bCYN};gGg*xCK_N3%%;#+cL9q~KdN1$+8`DB2FCTOKDj( zEujXc^mIJk@X+*Nk*V%{3=X{@v3ydH#5RIhrop zk&HZXA$F#!=*}Qys*#yH2TkmC#pcSqJKC9=TShK3+{OLHDQ=BZypd_~#htXC8VZiwOySYUp!kKtyGDLCv9!KgQ@TAvHG-X zP-$h(9!slK4EC4O4QG#as&?L!`0ypqN;jsAUas1!Zb({6oF`A{!&kjz++io%!6+TZ z`{3|YE+{b7p5GK(CT;4fdW++B(J#&x$8!0hTq($n=KaC=!n7zG6#RqbsZqb=l*U`j zg~%?Op&$%wlb%AM809KU!HzOeESJXoeL>!*4pKG=@n02z66D$XE?XP0tZca~afTM0 zp}K6_52-QnHZ^gQ&(OLz?JY&S?RBXwQ#Rl0so74zK0sH}23uZhe+wy2U)tV}*Yg6p z&elBJDrrkl%lW}(++bbF_o#YU$3qSbS9z5pk*XA)NygCrwQyxRkLevLPGKKp<)A1X5<1K(%QSNSoCH zHKtjh*0c&NFl_=0O-5jm=@KxeTL5O4z+%%YP-pfF)SEtmC8l3ssj(T016yW>1sY6F zpwajO%guzq3NtCN(o6|7nHhmq=3ar-p!H_^!=qj*X7q?2E0V58{8H#}T_ka(G)(gHx=z8#o&|dHzLi@nZ#rD4j zBXj`l9L$0r5bY-LBSHtkj|ugIpAxzm?A*Eq{EBF|g5MAt0KX|T2tF-z2>fHAA+U4n zHt&XTkpx%0X2NjY8E3 zjX^aDjYF*y@}V{h9f5LwOh7po?u6==y8%>>&`~Jo$0U^VBM)_(+?|3N7Aim;7Aivd zLeo%z&} z|8V#qG&}q%+zZ^kAfW4<`Vh1jVqX@}txo+qbeqFRpt~G?1A4o|N1??P&^MuXIrTB< z{SLnceaPYC(BcQ^+t4FUeF9p%0X+#l<gnrnmPeVWI@EPb6 z4xfb<7eLQJ|G=rwL%;6u1!yq>^dj^-PJIdbV}~z8|J>nsp?~G@73euzz6ULv!oDt{ z&&3Vq&OhisUj6{|PTG^z9f01cc?V#pJ%foF=ml!zA}v=vv_jX>N_~!+s!r3Y#7SE1 z9j7(klhk1QSnIt;>;CJI?_%L;T=eAzxi9MaXaV}w#6Z3yX_ki3u*6=(@*Q%K$a E0Uxxw^Z)<= literal 0 HcmV?d00001 diff --git a/kotlin/sieve/sieve.iml b/kotlin/sieve/sieve.iml new file mode 100644 index 0000000..fd47425 --- /dev/null +++ b/kotlin/sieve/sieve.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sieve/src/main/kotlin/.keep b/kotlin/sieve/src/main/kotlin/.keep new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/sieve/src/main/kotlin/Sieve.kt b/kotlin/sieve/src/main/kotlin/Sieve.kt new file mode 100644 index 0000000..4abdb52 --- /dev/null +++ b/kotlin/sieve/src/main/kotlin/Sieve.kt @@ -0,0 +1,22 @@ +object Sieve { + fun primesUpTo(x: Int): List{ + val boolArray: MutableList = mutableListOf() + for (i in 0..x){ + boolArray.add(true) + } + + for (i in 2..Math.sqrt(x.toDouble()).toInt()){ + if (boolArray[i] == true){ + for (j in IntRange(i*i, x).step(i)){ + boolArray[j] = false + } + } + } + + val returnArray = mutableListOf() + for (i in 2..boolArray.size-1){ + if (boolArray[i] == true) returnArray.add(i) + } + return returnArray + } +} \ No newline at end of file diff --git a/kotlin/sieve/src/test/kotlin/SieveTest.kt b/kotlin/sieve/src/test/kotlin/SieveTest.kt new file mode 100644 index 0000000..5c23ce8 --- /dev/null +++ b/kotlin/sieve/src/test/kotlin/SieveTest.kt @@ -0,0 +1,36 @@ +import org.junit.Test +import org.junit.Ignore +import kotlin.test.assertEquals + +class SieveTest { + + + @Test + fun findFirstPrime() { + val expectedOutput = listOf(2) + + assertEquals(expectedOutput, Sieve.primesUpTo(2)) + } + + @Test + fun findPrimesUpTo10() { + val expectedOutput = listOf(2, 3, 5, 7) + + assertEquals(expectedOutput, Sieve.primesUpTo(10)) + } + + @Test + fun findPrimesUpTo1000() { + val expectedOutput = listOf(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, + 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, + 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, + 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, + 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, + 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, + 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, + 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, + 991, 997) + + assertEquals(expectedOutput, Sieve.primesUpTo(1000)) + } +} diff --git a/kotlin/sum-of-multiples/.gradle/3.5/file-changes/last-build.bin b/kotlin/sum-of-multiples/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/sum-of-multiples/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/sum-of-multiples/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..d83c1220ef6bd769127e549a98eb67b6f56aa51b GIT binary patch literal 17 TcmZQpOkJ|WWn!5c0~7!NDeMDR literal 0 HcmV?d00001 diff --git a/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/built.bin b/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties b/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..8a60dfa --- /dev/null +++ b/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Mon Jul 17 15:37:15 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/sum-of-multiples/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/compiler.xml b/kotlin/sum-of-multiples/.idea/compiler.xml new file mode 100644 index 0000000..854af36 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/gradle.xml b/kotlin/sum-of-multiples/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/sum-of-multiples/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..c4f27b9 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..e29af23 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..8dc5a86 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..caa2881 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..6325d98 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..1f91870 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/misc.xml b/kotlin/sum-of-multiples/.idea/misc.xml new file mode 100644 index 0000000..8b84aec --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/misc.xml @@ -0,0 +1,22 @@ + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/modules.xml b/kotlin/sum-of-multiples/.idea/modules.xml new file mode 100644 index 0000000..24fd922 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_main.iml b/kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_main.iml new file mode 100644 index 0000000..7efd839 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_main.iml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_test.iml b/kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_test.iml new file mode 100644 index 0000000..d351029 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/modules/sum-of-multiples_test.iml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/.idea/workspace.xml b/kotlin/sum-of-multiples/.idea/workspace.xml new file mode 100644 index 0000000..5d9b2d3 --- /dev/null +++ b/kotlin/sum-of-multiples/.idea/workspace.xml @@ -0,0 +1,931 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Ignore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1500320224570 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/sum-of-multiples/README.md b/kotlin/sum-of-multiples/README.md new file mode 100644 index 0000000..abfbffe --- /dev/null +++ b/kotlin/sum-of-multiples/README.md @@ -0,0 +1,20 @@ +# Sum Of Multiples + +Given a number, find the sum of all the multiples of particular numbers up to +but not including that number. + +If we list all the natural numbers up to but not including 20 that are +multiples of either 3 or 5, we get 3, 5, 6 and 9, 10, 12, 15, and 18. + +The sum of these multiples is 78. + +Given a number, find the sum of the multiples of a given set of numbers, +up to but not including that number. + +## Source + +A variation on Problem 1 at Project Euler [http://projecteuler.net/problem=1](http://projecteuler.net/problem=1) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/sum-of-multiples/build.gradle b/kotlin/sum-of-multiples/build.gradle new file mode 100644 index 0000000..4727190 --- /dev/null +++ b/kotlin/sum-of-multiples/build.gradle @@ -0,0 +1,29 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} + +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/sum-of-multiples/build/classes/main/SumOfMultiples.class b/kotlin/sum-of-multiples/build/classes/main/SumOfMultiples.class new file mode 100644 index 0000000000000000000000000000000000000000..548efb97d73d0fc83475ad8ef04115b11747ab80 GIT binary patch literal 1930 zcmZuy-%}e^6#njJlie(#gkR-{(8f{=3D6L#s02}dN=gXW(A1VHZjvP|*=(5XhT)M1 z$NxcJoY9B+;EUsofSu`N>YK0rH9lB8_a-U9Is^Bf``vTTe&0Fg-u(IM_ZI-Bkz=@) zu9i0UHma6u9$JQ@fH4FQ^dmiL>2@KynLRLat^yB($ElVWy2p}Yx9XZ!G;O%?L^#1P zk}OvW(F4QHR&>*LqPlIDUEMXyWT(n*s%lwr2F0`wlcwXUP#JC%%dTbG(SxH>)U;ir zV(V5kVY?MNZ{~=I#?Y7BH*&=-y`q;4@<=$1SPY{L8Z9K_bz%ZZ^Du>YI1@ks?Hbx} zjiOx=Pnveo$gkz8C2JW9W*9<^y64K4MXe=TWa-jg zr*eEiBB-A; zCavm{KE%SO{fY*>L58Z1od^A5MnD48Emd3mM zXXtp2&c~a(8t(6w5?$H0uxXbNE{P5jl;kN&r2)JeSyE}J^g~>Nca-FH2Wo@qmaQNdNgT8 zS;Y*^oMs?$iq%LB(yvJTB7C^$Kz*+vi%akcgzgsZzm9QJV1V)*(kUMC<4ovnI(zUH zVG`-nY2Hn5ENp3SG`F@cerB{tI@GjQwee6a^rq)kM2jS~*hp+5c5gPOMOHLq=_8v& wVVzQ%+<_;74e^)4W^=Vg06ycxgB>sjX>9Mn?_k-%LkHasyuwh$xZ)u5FLOJ#_y7O^ literal 0 HcmV?d00001 diff --git a/kotlin/sum-of-multiples/build/classes/test/SumOfMultiplesTest.class b/kotlin/sum-of-multiples/build/classes/test/SumOfMultiplesTest.class new file mode 100644 index 0000000000000000000000000000000000000000..45efd43a1667b19f29c87b513560625abc3ffba3 GIT binary patch literal 3119 zcmb7_OHX4Ghzib~*wJD)58)%FJ}f zC+M=vF1qTbi+0g6nQ4c~va5cKeu_@dm1V`Ys5*FT>D<@(opbIv$AA9w_74CVe9X|d zT`zAPZq!Sraaz*(j?T?67=wJQooQ-Gs~o9Y`^WkL&H5Qe%gv3k>S1g?R;|UdvHEGu ztj5v|{`kx;oh(#qN9u9CVwkE>x5S{lSC+4s`jK7>Bf=0q(@J%H>yY7QJU>%#ZCZ*# z!VL*sh%)rF8yZFrLnObsy|cWzvMQ+U>vUFz(uH31F$|wn&5}`352~dSxnfi+T;0}9 zzD`~ZFa)`73M(e#do4yZ++MQns+&ehoFTn8aZAD=hR9)FFEjMV8>gHt`I&qaBN&y4 zew$&)rkfNDb(wR$W?3NMV+;eDHM9D4T`Td)qJF4Rh#3mD(v}-oavRq&vu)Ol%F$B3 zWvc1HZWJ+0NEpXmhJg8%!3odeP29L29>iL8NJ}nWkBWSeuG$f);7VLuZG})~s01G&4O*sorkIf@Q)& z(}Z-2K7LGmPbo6g#!5FCDPr8a;)<`zwt10l6#c0-Razycmru=aVwAk^wF;S8))i#qkpLiIo^?P@hc+b`)m;=#~cFe>_Hy}Ym2?3v-$^@?ef^<9G-v}L(c zshXNq`V7)`wO%{WUm7JHY4|Ak;?n~KL4;_$PNPprA~P}Tzd-jd=nwvmt~dS=4YuC| zBI0#{;lQuBLm~^a3*7secKcAEXS8t=lbE8>2K^*j0kzT@k~T>ay2JEVaNkW7kpCiv zuSe`9qTE58c8H(ZJ|^T_9!Od8VkTT(4&niI>2@#US1>odm;={ijuP{B2Xn?@?%94O zm98EyXweIrbU8YK1nzb~XWh`g2Odnt|M&Hv(*%uoKobtMXnUHI=Nr(Fm9}!2MwGX5 zxAhLnig;53%bs!0xm->ni@6SZ(xE$Xmd6_OM$t6kR`CdE@AX`sCzlsGpmPpXw_RRT zl$8dx;j>kvMx3oA}{or02b;b1v#L zB=Nk1nsTUL*i^MI-3paOs)>76ZK^UYdtp@&-UQY, maxNum: Int): Int { + val setOfMultiples = mutableSetOf() + for (i in 1..maxNum-1){ + for (j in inpList) { + if (i % j == 0){ + setOfMultiples.add(i) + } + } + } + return setOfMultiples.sum() + } +} \ No newline at end of file diff --git a/kotlin/sum-of-multiples/src/test/kotlin/SumOfMultiplesTest.kt b/kotlin/sum-of-multiples/src/test/kotlin/SumOfMultiplesTest.kt new file mode 100644 index 0000000..e308ca8 --- /dev/null +++ b/kotlin/sum-of-multiples/src/test/kotlin/SumOfMultiplesTest.kt @@ -0,0 +1,84 @@ +import org.junit.Ignore +import org.junit.Test +import kotlin.test.assertEquals + +class SumOfMultiplesTest { + + @Test + fun `multiples of 3 or 5 up to 1`() { + assertEquals(0, SumOfMultiples.sum(setOf(3, 5), 1)) + } + + @Test + + fun `multiples of 3 or 5 up to 4`() { + assertEquals(3, SumOfMultiples.sum(setOf(3, 5), 4)) + } + + @Test + + fun `multiples of 3 or 5 up to 10`() { + assertEquals(23, SumOfMultiples.sum(setOf(3, 5), 10)) + } + + @Test + + fun `multiples of 3 or 5 up to 20`() { + assertEquals(78, SumOfMultiples.sum(setOf(3, 5), 20)) + } + + @Test + + fun `multiples of 3 or 5 up to 100`() { + assertEquals(2318, SumOfMultiples.sum(setOf(3, 5), 100)) + } + + @Test + + fun `multiples of 3 or 5 up to 1000`() { + assertEquals(233_168, SumOfMultiples.sum(setOf(3, 5), 1000)) + } + + @Test + + fun `multiples of 7, 13 or 17 up to 20`() { + assertEquals(51, SumOfMultiples.sum(setOf(7, 13, 17), 20)) + } + + @Test + + fun `multiples of 4 or 6 up to 15`() { + assertEquals(30, SumOfMultiples.sum(setOf(4, 6), 15)) + } + + @Test + + fun `multiples of 5, 6 or 8 up to 150`() { + assertEquals(4419, SumOfMultiples.sum(setOf(5, 6, 8), 150)) + } + + @Test + + fun `multiples of 5 or 25 up to 51`() { + assertEquals(275, SumOfMultiples.sum(setOf(5, 25), 51)) + } + + @Test + + fun `multiples of 43 or 47 up to 10000`() { + assertEquals(2_203_160, SumOfMultiples.sum(setOf(43, 47), 10_000)) + } + + @Test + + fun `multiples of 1 up to 100`() { + assertEquals(4950, SumOfMultiples.sum(setOf(1), 100)) + } + + @Test + + fun `multiples of an empty set up to 10000`() { + assertEquals(0, SumOfMultiples.sum(emptySet(), 10_000)) + } + +} diff --git a/kotlin/sum-of-multiples/sum-of-multiples.iml b/kotlin/sum-of-multiples/sum-of-multiples.iml new file mode 100644 index 0000000..97f46c9 --- /dev/null +++ b/kotlin/sum-of-multiples/sum-of-multiples.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.gradle/3.5/file-changes/last-build.bin b/kotlin/triangle/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/triangle/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/triangle/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..e0a6706500e382b6d7510c3dd97a9dd987001322 GIT binary patch literal 17 TcmZSPzbII@DgO^I0~7!NEHML} literal 0 HcmV?d00001 diff --git a/kotlin/triangle/.gradle/buildOutputCleanup/built.bin b/kotlin/triangle/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/triangle/.gradle/buildOutputCleanup/cache.properties b/kotlin/triangle/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..cc5378f --- /dev/null +++ b/kotlin/triangle/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Tue Jul 18 16:45:35 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/triangle/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/triangle/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/triangle/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/triangle/.idea/compiler.xml b/kotlin/triangle/.idea/compiler.xml new file mode 100644 index 0000000..d77dcc1 --- /dev/null +++ b/kotlin/triangle/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/gradle.xml b/kotlin/triangle/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/triangle/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/triangle/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..c4f27b9 --- /dev/null +++ b/kotlin/triangle/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/triangle/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..e29af23 --- /dev/null +++ b/kotlin/triangle/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..8dc5a86 --- /dev/null +++ b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..caa2881 --- /dev/null +++ b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..6325d98 --- /dev/null +++ b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..1f91870 --- /dev/null +++ b/kotlin/triangle/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/misc.xml b/kotlin/triangle/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/triangle/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/modules.xml b/kotlin/triangle/.idea/modules.xml new file mode 100644 index 0000000..d58d2cd --- /dev/null +++ b/kotlin/triangle/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/modules/triangle_main.iml b/kotlin/triangle/.idea/modules/triangle_main.iml new file mode 100644 index 0000000..c4442b8 --- /dev/null +++ b/kotlin/triangle/.idea/modules/triangle_main.iml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/modules/triangle_test.iml b/kotlin/triangle/.idea/modules/triangle_test.iml new file mode 100644 index 0000000..44f61c5 --- /dev/null +++ b/kotlin/triangle/.idea/modules/triangle_test.iml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/triangle/.idea/workspace.xml b/kotlin/triangle/.idea/workspace.xml new file mode 100644 index 0000000..32de453 --- /dev/null +++ b/kotlin/triangle/.idea/workspace.xml @@ -0,0 +1,881 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @ignore + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +