diff --git a/kotlin/allergies/.gradle/4.0.1/fileChanges/last-build.bin b/kotlin/allergies/.gradle/4.0.1/fileChanges/last-build.bin
new file mode 100644
index 0000000..f76dd23
Binary files /dev/null and b/kotlin/allergies/.gradle/4.0.1/fileChanges/last-build.bin differ
diff --git a/kotlin/allergies/.gradle/4.0.1/fileHashes/fileHashes.bin b/kotlin/allergies/.gradle/4.0.1/fileHashes/fileHashes.bin
new file mode 100644
index 0000000..06d37f8
Binary files /dev/null and b/kotlin/allergies/.gradle/4.0.1/fileHashes/fileHashes.bin differ
diff --git a/kotlin/allergies/.gradle/4.0.1/fileHashes/fileHashes.lock b/kotlin/allergies/.gradle/4.0.1/fileHashes/fileHashes.lock
new file mode 100644
index 0000000..e0c8047
Binary files /dev/null and b/kotlin/allergies/.gradle/4.0.1/fileHashes/fileHashes.lock differ
diff --git a/kotlin/allergies/.gradle/buildOutputCleanup/built.bin b/kotlin/allergies/.gradle/buildOutputCleanup/built.bin
new file mode 100644
index 0000000..e69de29
diff --git a/kotlin/allergies/.gradle/buildOutputCleanup/cache.properties b/kotlin/allergies/.gradle/buildOutputCleanup/cache.properties
new file mode 100644
index 0000000..3dfcde1
--- /dev/null
+++ b/kotlin/allergies/.gradle/buildOutputCleanup/cache.properties
@@ -0,0 +1,2 @@
+#Tue Aug 01 11:46:33 EDT 2017
+gradle.version=4.0.1
diff --git a/kotlin/allergies/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/allergies/.gradle/buildOutputCleanup/cache.properties.lock
new file mode 100644
index 0000000..40fdece
--- /dev/null
+++ b/kotlin/allergies/.gradle/buildOutputCleanup/cache.properties.lock
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/compiler.xml b/kotlin/allergies/.idea/compiler.xml
new file mode 100644
index 0000000..a9cb603
--- /dev/null
+++ b/kotlin/allergies/.idea/compiler.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/gradle.xml b/kotlin/allergies/.idea/gradle.xml
new file mode 100644
index 0000000..0b86376
--- /dev/null
+++ b/kotlin/allergies/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/allergies/.idea/libraries/Gradle__junit_junit_4_12.xml
new file mode 100644
index 0000000..c4f27b9
--- /dev/null
+++ b/kotlin/allergies/.idea/libraries/Gradle__junit_junit_4_12.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/allergies/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..e29af23
--- /dev/null
+++ b/kotlin/allergies/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
new file mode 100644
index 0000000..8dc5a86
--- /dev/null
+++ b/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml
new file mode 100644
index 0000000..caa2881
--- /dev/null
+++ b/kotlin/allergies/.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/allergies/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml
new file mode 100644
index 0000000..6325d98
--- /dev/null
+++ b/kotlin/allergies/.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/allergies/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/allergies/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml
new file mode 100644
index 0000000..1f91870
--- /dev/null
+++ b/kotlin/allergies/.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/allergies/.idea/misc.xml b/kotlin/allergies/.idea/misc.xml
new file mode 100644
index 0000000..bb3b391
--- /dev/null
+++ b/kotlin/allergies/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/modules.xml b/kotlin/allergies/.idea/modules.xml
new file mode 100644
index 0000000..f5a26e4
--- /dev/null
+++ b/kotlin/allergies/.idea/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/modules/allergies_main.iml b/kotlin/allergies/.idea/modules/allergies_main.iml
new file mode 100644
index 0000000..e28b1e7
--- /dev/null
+++ b/kotlin/allergies/.idea/modules/allergies_main.iml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/modules/allergies_test.iml b/kotlin/allergies/.idea/modules/allergies_test.iml
new file mode 100644
index 0000000..c93a5aa
--- /dev/null
+++ b/kotlin/allergies/.idea/modules/allergies_test.iml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/.idea/workspace.xml b/kotlin/allergies/.idea/workspace.xml
new file mode 100644
index 0000000..0623595
--- /dev/null
+++ b/kotlin/allergies/.idea/workspace.xml
@@ -0,0 +1,747 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Ignore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1501602382408
+
+
+ 1501602382408
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Java 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/README.md b/kotlin/allergies/README.md
new file mode 100644
index 0000000..6cc114f
--- /dev/null
+++ b/kotlin/allergies/README.md
@@ -0,0 +1,40 @@
+# Allergies
+
+Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
+
+An allergy test produces a single numeric score which contains the
+information about all the allergies the person has (that they were
+tested for).
+
+The list of items (and their value) that were tested are:
+
+* eggs (1)
+* peanuts (2)
+* shellfish (4)
+* strawberries (8)
+* tomatoes (16)
+* chocolate (32)
+* pollen (64)
+* cats (128)
+
+So if Tom is allergic to peanuts and chocolate, he gets a score of 34.
+
+Now, given just that score of 34, your program should be able to say:
+
+- Whether Tom is allergic to any one of those allergens listed above.
+- All the allergens Tom is allergic to.
+
+Note: a given score may include allergens **not** listed above (i.e.
+allergens that score 256, 512, 1024, etc.). Your program should
+ignore those components of the score. For example, if the allergy
+score is 257, your program should only report the eggs (1) allergy.
+
+
+
+
+## Source
+
+Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com)
+
+## 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/allergies/allergies.iml b/kotlin/allergies/allergies.iml
new file mode 100644
index 0000000..dbf4693
--- /dev/null
+++ b/kotlin/allergies/allergies.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/allergies/build.gradle b/kotlin/allergies/build.gradle
new file mode 100644
index 0000000..16c36c0
--- /dev/null
+++ b/kotlin/allergies/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/allergies/src/main/kotlin/Allergen.kt b/kotlin/allergies/src/main/kotlin/Allergen.kt
new file mode 100644
index 0000000..b02897b
--- /dev/null
+++ b/kotlin/allergies/src/main/kotlin/Allergen.kt
@@ -0,0 +1,48 @@
+
+import jdk.nashorn.tools.ShellFunctions.input
+
+enum class Allergen(val score: Int) {
+ EGGS(1),
+ PEANUTS(2),
+ SHELLFISH(4),
+ STRAWBERRIES(8),
+ TOMATOES(16),
+ CHOCOLATE(32),
+ POLLEN(64),
+ CATS(128)
+}
+
+class Allergies(val allergyScore: Int){
+ fun isAllergicTo(allergen: Allergen): Boolean {
+ return getList().contains(allergen)
+ }
+
+ fun getList(): List{
+ val returnList = mutableListOf()
+ if (1 and allergyScore == 1){
+ returnList.add(Allergen.EGGS)
+ }
+ if (2 and allergyScore == 2){
+ returnList.add(Allergen.PEANUTS)
+ }
+ if (4 and allergyScore == 4){
+ returnList.add(Allergen.SHELLFISH)
+ }
+ if (8 and allergyScore == 8){
+ returnList.add(Allergen.STRAWBERRIES)
+ }
+ if (16 and allergyScore == 16){
+ returnList.add(Allergen.TOMATOES)
+ }
+ if (32 and allergyScore == 32){
+ returnList.add(Allergen.CHOCOLATE)
+ }
+ if (64 and allergyScore == 64){
+ returnList.add(Allergen.POLLEN)
+ }
+ if (128 and allergyScore == 128){
+ returnList.add(Allergen.CATS)
+ }
+ return returnList
+ }
+}
\ No newline at end of file
diff --git a/kotlin/allergies/src/test/kotlin/AllergiesTest.kt b/kotlin/allergies/src/test/kotlin/AllergiesTest.kt
new file mode 100644
index 0000000..f469e0d
--- /dev/null
+++ b/kotlin/allergies/src/test/kotlin/AllergiesTest.kt
@@ -0,0 +1,198 @@
+import org.junit.Test
+import org.junit.Ignore
+import kotlin.test.assertEquals
+
+class AllergiesTest {
+
+
+ @Test
+ fun noAllergiesMeansNotAllergicToAnything() {
+ val allergies = Allergies(0)
+
+ assertEquals(false, allergies.isAllergicTo(Allergen.EGGS))
+ assertEquals(false, allergies.isAllergicTo(Allergen.PEANUTS))
+ assertEquals(false, allergies.isAllergicTo(Allergen.STRAWBERRIES))
+ assertEquals(false, allergies.isAllergicTo(Allergen.CATS))
+ }
+
+
+ @Test
+ fun allergicToEggs() {
+ val allergies = Allergies(1)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.EGGS))
+ }
+
+
+ @Test
+ fun allergicToPeanuts() {
+ val allergies = Allergies(2)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.PEANUTS))
+ }
+
+
+ @Test
+ fun allergicToShellfish() {
+ val allergies = Allergies(4)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.SHELLFISH))
+ }
+
+
+ @Test
+ fun allergicToStrawberries() {
+ val allergies = Allergies(8)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.STRAWBERRIES))
+ }
+
+
+ @Test
+ fun allergicToTomatoes() {
+ val allergies = Allergies(16)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.TOMATOES))
+ }
+
+
+ @Test
+ fun allergicToChocolate() {
+ val allergies = Allergies(32)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.CHOCOLATE))
+ }
+
+
+ @Test
+ fun allergicToPollen() {
+ val allergies = Allergies(64)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.POLLEN))
+ }
+
+
+ @Test
+ fun allergicToCats() {
+ val allergies = Allergies(128)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.CATS))
+ }
+
+
+ @Test
+ fun isAllergicToEggsInAdditionToOtherStuff() {
+ val allergies = Allergies(5)
+
+ assertEquals(true, allergies.isAllergicTo(Allergen.EGGS))
+ }
+
+
+ @Test
+ fun noAllergies() {
+ val allergies = Allergies(0)
+
+ assertEquals(0, allergies.getList().size)
+ }
+
+
+ @Test
+ fun isAllergicToJustEggs() {
+ val allergies = Allergies(1)
+ val expectedAllergens = listOf(Allergen.EGGS)
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun isAllergicToJustPeanuts() {
+ val allergies = Allergies(2)
+ val expectedAllergens = listOf(Allergen.PEANUTS)
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun isAllergicToJustStrawberries() {
+ val allergies = Allergies(8)
+ val expectedAllergens = listOf(Allergen.STRAWBERRIES)
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun isAllergicToEggsAndPeanuts() {
+ val allergies = Allergies(3)
+ val expectedAllergens = listOf(
+ Allergen.EGGS,
+ Allergen.PEANUTS
+ )
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun isAllergicToEggsAndShellfish() {
+ val allergies = Allergies(5)
+ val expectedAllergens = listOf(
+ Allergen.EGGS,
+ Allergen.SHELLFISH
+ )
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun isAllergicToLotsOfStuff() {
+ val allergies = Allergies(248)
+ val expectedAllergens = listOf(
+ Allergen.STRAWBERRIES,
+ Allergen.TOMATOES,
+ Allergen.CHOCOLATE,
+ Allergen.POLLEN,
+ Allergen.CATS
+ )
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun isAllergicToEverything() {
+ val allergies = Allergies(255)
+ val expectedAllergens = listOf(
+ Allergen.EGGS,
+ Allergen.PEANUTS,
+ Allergen.SHELLFISH,
+ Allergen.STRAWBERRIES,
+ Allergen.TOMATOES,
+ Allergen.CHOCOLATE,
+ Allergen.POLLEN,
+ Allergen.CATS
+ )
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+
+
+ @Test
+ fun ignoreNonAllergenScoreParts() {
+ val allergies = Allergies(509)
+ val expectedAllergens = listOf(
+ Allergen.EGGS,
+ Allergen.SHELLFISH,
+ Allergen.STRAWBERRIES,
+ Allergen.TOMATOES,
+ Allergen.CHOCOLATE,
+ Allergen.POLLEN,
+ Allergen.CATS
+ )
+
+ assertEquals(expectedAllergens, allergies.getList())
+ }
+}
diff --git a/kotlin/grains/.idea/workspace.xml b/kotlin/grains/.idea/workspace.xml
index 6af33e3..0dccc96 100644
--- a/kotlin/grains/.idea/workspace.xml
+++ b/kotlin/grains/.idea/workspace.xml
@@ -18,27 +18,17 @@
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
@@ -426,6 +416,8 @@
+
+
@@ -468,15 +460,13 @@
-
-
-
+
@@ -632,34 +622,35 @@
-
+
-
+
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
-
+
-
+
+
-
-
+
+
+
+
+
@@ -673,6 +664,14 @@
+
+
+
+
+
+
+
+
@@ -684,22 +683,41 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
diff --git a/kotlin/nth-prime/.idea/workspace.xml b/kotlin/nth-prime/.idea/workspace.xml
index 5094b73..16ac755 100644
--- a/kotlin/nth-prime/.idea/workspace.xml
+++ b/kotlin/nth-prime/.idea/workspace.xml
@@ -18,11 +18,11 @@
-
+
-
+
@@ -32,8 +32,8 @@
-
-
+
+
@@ -43,7 +43,7 @@
-
+
@@ -426,8 +426,8 @@
-
+
@@ -476,7 +476,7 @@
-
+
@@ -626,34 +626,35 @@
-
+
-
+
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
-
+
-
+
+
-
-
+
+
+
+
+
@@ -667,10 +668,37 @@
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -680,7 +708,7 @@
-
+
@@ -688,8 +716,8 @@
-
-
+
+
diff --git a/kotlin/pig-latin/.idea/workspace.xml b/kotlin/pig-latin/.idea/workspace.xml
index b26dd35..c9cbe7a 100644
--- a/kotlin/pig-latin/.idea/workspace.xml
+++ b/kotlin/pig-latin/.idea/workspace.xml
@@ -18,7 +18,7 @@
-
+
@@ -32,7 +32,7 @@
-
+
@@ -406,9 +406,6 @@
-
-
-
@@ -451,10 +448,13 @@
+
+
+
-
+
@@ -529,21 +529,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -578,6 +563,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -607,9 +610,6 @@
-
-
-
@@ -656,32 +656,32 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
-
+
-
-
+
+
-
-
+
+
+
+
+
@@ -692,6 +692,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -705,7 +732,7 @@
-
+
diff --git a/kotlin/prime-factors/.gradle/4.0.1/fileChanges/last-build.bin b/kotlin/prime-factors/.gradle/4.0.1/fileChanges/last-build.bin
new file mode 100644
index 0000000..f76dd23
Binary files /dev/null and b/kotlin/prime-factors/.gradle/4.0.1/fileChanges/last-build.bin differ
diff --git a/kotlin/prime-factors/.gradle/4.0.1/fileHashes/fileHashes.bin b/kotlin/prime-factors/.gradle/4.0.1/fileHashes/fileHashes.bin
new file mode 100644
index 0000000..a146973
Binary files /dev/null and b/kotlin/prime-factors/.gradle/4.0.1/fileHashes/fileHashes.bin differ
diff --git a/kotlin/prime-factors/.gradle/4.0.1/fileHashes/fileHashes.lock b/kotlin/prime-factors/.gradle/4.0.1/fileHashes/fileHashes.lock
new file mode 100644
index 0000000..bcf461d
Binary files /dev/null and b/kotlin/prime-factors/.gradle/4.0.1/fileHashes/fileHashes.lock differ
diff --git a/kotlin/prime-factors/.gradle/buildOutputCleanup/built.bin b/kotlin/prime-factors/.gradle/buildOutputCleanup/built.bin
new file mode 100644
index 0000000..e69de29
diff --git a/kotlin/prime-factors/.gradle/buildOutputCleanup/cache.properties b/kotlin/prime-factors/.gradle/buildOutputCleanup/cache.properties
new file mode 100644
index 0000000..18918ee
--- /dev/null
+++ b/kotlin/prime-factors/.gradle/buildOutputCleanup/cache.properties
@@ -0,0 +1,2 @@
+#Mon Jul 31 14:03:23 EDT 2017
+gradle.version=4.0.1
diff --git a/kotlin/prime-factors/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/prime-factors/.gradle/buildOutputCleanup/cache.properties.lock
new file mode 100644
index 0000000..40fdece
--- /dev/null
+++ b/kotlin/prime-factors/.gradle/buildOutputCleanup/cache.properties.lock
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/compiler.xml b/kotlin/prime-factors/.idea/compiler.xml
new file mode 100644
index 0000000..14f709a
--- /dev/null
+++ b/kotlin/prime-factors/.idea/compiler.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/gradle.xml b/kotlin/prime-factors/.idea/gradle.xml
new file mode 100644
index 0000000..0b86376
--- /dev/null
+++ b/kotlin/prime-factors/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/prime-factors/.idea/libraries/Gradle__junit_junit_4_12.xml
new file mode 100644
index 0000000..c4f27b9
--- /dev/null
+++ b/kotlin/prime-factors/.idea/libraries/Gradle__junit_junit_4_12.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/prime-factors/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..e29af23
--- /dev/null
+++ b/kotlin/prime-factors/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
new file mode 100644
index 0000000..8dc5a86
--- /dev/null
+++ b/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml
new file mode 100644
index 0000000..caa2881
--- /dev/null
+++ b/kotlin/prime-factors/.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/prime-factors/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml
new file mode 100644
index 0000000..6325d98
--- /dev/null
+++ b/kotlin/prime-factors/.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/prime-factors/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/prime-factors/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml
new file mode 100644
index 0000000..1f91870
--- /dev/null
+++ b/kotlin/prime-factors/.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/prime-factors/.idea/misc.xml b/kotlin/prime-factors/.idea/misc.xml
new file mode 100644
index 0000000..bb3b391
--- /dev/null
+++ b/kotlin/prime-factors/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/modules.xml b/kotlin/prime-factors/.idea/modules.xml
new file mode 100644
index 0000000..eb1fc26
--- /dev/null
+++ b/kotlin/prime-factors/.idea/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/modules/prime-factors_main.iml b/kotlin/prime-factors/.idea/modules/prime-factors_main.iml
new file mode 100644
index 0000000..4188039
--- /dev/null
+++ b/kotlin/prime-factors/.idea/modules/prime-factors_main.iml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/modules/prime-factors_test.iml b/kotlin/prime-factors/.idea/modules/prime-factors_test.iml
new file mode 100644
index 0000000..7ac3ce9
--- /dev/null
+++ b/kotlin/prime-factors/.idea/modules/prime-factors_test.iml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/.idea/workspace.xml b/kotlin/prime-factors/.idea/workspace.xml
new file mode 100644
index 0000000..7015c8c
--- /dev/null
+++ b/kotlin/prime-factors/.idea/workspace.xml
@@ -0,0 +1,805 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Ignore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1501524161533
+
+
+ 1501524161533
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Java 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/README.md b/kotlin/prime-factors/README.md
new file mode 100644
index 0000000..df24a5f
--- /dev/null
+++ b/kotlin/prime-factors/README.md
@@ -0,0 +1,39 @@
+# Prime Factors
+
+Compute the prime factors of a given natural number.
+
+A prime number is only evenly divisible by itself and 1.
+
+Note that 1 is not a prime number.
+
+## Example
+
+What are the prime factors of 60?
+
+- Our first divisor is 2. 2 goes into 60, leaving 30.
+- 2 goes into 30, leaving 15.
+ - 2 doesn't go cleanly into 15. So let's move on to our next divisor, 3.
+- 3 goes cleanly into 15, leaving 5.
+ - 3 does not go cleanly into 5. The next possible factor is 4.
+ - 4 does not go cleanly into 5. The next possible factor is 5.
+- 5 does go cleanly into 5.
+- We're left only with 1, so now, we're done.
+
+Our successful divisors in that computation represent the list of prime
+factors of 60: 2, 2, 3, and 5.
+
+You can check this yourself:
+
+- 2 * 2 * 3 * 5
+- = 4 * 15
+- = 60
+- Success!
+
+
+
+## Source
+
+The Prime Factors Kata by Uncle Bob [http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata](http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata)
+
+## 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/prime-factors/build.gradle b/kotlin/prime-factors/build.gradle
new file mode 100644
index 0000000..16c36c0
--- /dev/null
+++ b/kotlin/prime-factors/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/prime-factors/out/production/classes/META-INF/prime-factors_main.kotlin_module b/kotlin/prime-factors/out/production/classes/META-INF/prime-factors_main.kotlin_module
new file mode 100644
index 0000000..7abc032
Binary files /dev/null and b/kotlin/prime-factors/out/production/classes/META-INF/prime-factors_main.kotlin_module differ
diff --git a/kotlin/prime-factors/prime-factors.iml b/kotlin/prime-factors/prime-factors.iml
new file mode 100644
index 0000000..d0d9fc1
--- /dev/null
+++ b/kotlin/prime-factors/prime-factors.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/prime-factors/src/main/kotlin/.keep b/kotlin/prime-factors/src/main/kotlin/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/kotlin/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt b/kotlin/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
new file mode 100644
index 0000000..ad531d5
--- /dev/null
+++ b/kotlin/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt
@@ -0,0 +1,51 @@
+import org.junit.Ignore
+import org.junit.Test
+import kotlin.test.assertEquals
+
+/*
+ * version: 1.0.0
+ */
+class PrimeFactorCalculatorTest {
+
+ @Test
+ fun testThat1HasNoPrimeFactors() {
+ assertEquals(emptyList(), PrimeFactorCalculator.primeFactors(1))
+ }
+
+
+ @Test
+ fun testThatAPrimeNumberHasExactlyOnePrimeFactor() {
+ assertEquals(listOf(2), PrimeFactorCalculator.primeFactors(2))
+ }
+
+
+ @Test
+ fun testThatASquareOfAPrimeHasExactlyOnePrimeFactorRepeatedTwice() {
+ assertEquals(listOf(3, 3), PrimeFactorCalculator.primeFactors(9))
+ }
+
+
+ @Test
+ fun testThatACubeOfAPrimeHasExactlyOnePrimeFactorRepeatedThreeTimes() {
+ assertEquals(listOf(2, 2, 2), PrimeFactorCalculator.primeFactors(8))
+ }
+
+
+ @Test
+ fun testThatAProductOfPrimesAndNonPrimesIsFactoredProperly() {
+ assertEquals(listOf(2, 2, 3), PrimeFactorCalculator.primeFactors(12))
+ }
+
+
+ @Test
+ fun testThatAProductOfSmallPrimesIsFactoredProperly() {
+ assertEquals(listOf(5, 17, 23, 461), PrimeFactorCalculator.primeFactors(901255))
+ }
+
+
+ @Test
+ fun testThatAProductOfSmallAndLargePrimesIsFactoredProperly() {
+ assertEquals(listOf(11, 9539, 894119), PrimeFactorCalculator.primeFactors(93819012551L))
+ }
+
+}
diff --git a/kotlin/secret-handshake/.idea/workspace.xml b/kotlin/secret-handshake/.idea/workspace.xml
index 723a05e..47a881a 100644
--- a/kotlin/secret-handshake/.idea/workspace.xml
+++ b/kotlin/secret-handshake/.idea/workspace.xml
@@ -11,7 +11,6 @@
-
@@ -22,7 +21,7 @@
-
+
@@ -32,14 +31,14 @@
-
+
-
+
@@ -52,18 +51,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -411,7 +398,7 @@
-
+
@@ -432,67 +419,10 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -513,28 +443,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -553,9 +462,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -574,7 +502,6 @@
-
@@ -582,7 +509,6 @@
-
@@ -597,7 +523,60 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -634,27 +613,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -701,14 +659,6 @@
-
-
-
-
-
-
-
-
@@ -773,33 +723,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -838,9 +763,6 @@
-
-
-
@@ -899,7 +821,7 @@
-
+
@@ -911,13 +833,14 @@
-
+
+
@@ -942,6 +865,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -987,6 +947,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -998,31 +984,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/sieve/.idea/misc.xml b/kotlin/sieve/.idea/misc.xml
index 6300ca8..9ce8f4d 100644
--- a/kotlin/sieve/.idea/misc.xml
+++ b/kotlin/sieve/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/kotlin/sieve/.idea/workspace.xml b/kotlin/sieve/.idea/workspace.xml
index be2d995..4d5a0f9 100644
--- a/kotlin/sieve/.idea/workspace.xml
+++ b/kotlin/sieve/.idea/workspace.xml
@@ -18,41 +18,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -421,7 +387,6 @@
-
@@ -465,13 +430,14 @@
+
-
+
@@ -631,12 +597,10 @@
-
-
+
-
@@ -644,19 +608,21 @@
-
+
+
-
-
+
+
+
@@ -674,6 +640,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -701,9 +694,17 @@
+
+
+
+
+
+
+
+
-
+
@@ -720,14 +721,6 @@
-
-
-
-
-
-
-
-
diff --git a/kotlin/spiral-matrix/.gradle/4.0.1/fileChanges/last-build.bin b/kotlin/spiral-matrix/.gradle/4.0.1/fileChanges/last-build.bin
new file mode 100644
index 0000000..f76dd23
Binary files /dev/null and b/kotlin/spiral-matrix/.gradle/4.0.1/fileChanges/last-build.bin differ
diff --git a/kotlin/spiral-matrix/.gradle/4.0.1/fileHashes/fileHashes.bin b/kotlin/spiral-matrix/.gradle/4.0.1/fileHashes/fileHashes.bin
new file mode 100644
index 0000000..8f40e23
Binary files /dev/null and b/kotlin/spiral-matrix/.gradle/4.0.1/fileHashes/fileHashes.bin differ
diff --git a/kotlin/spiral-matrix/.gradle/4.0.1/fileHashes/fileHashes.lock b/kotlin/spiral-matrix/.gradle/4.0.1/fileHashes/fileHashes.lock
new file mode 100644
index 0000000..b8e9382
Binary files /dev/null and b/kotlin/spiral-matrix/.gradle/4.0.1/fileHashes/fileHashes.lock differ
diff --git a/kotlin/spiral-matrix/.gradle/buildOutputCleanup/built.bin b/kotlin/spiral-matrix/.gradle/buildOutputCleanup/built.bin
new file mode 100644
index 0000000..e69de29
diff --git a/kotlin/spiral-matrix/.gradle/buildOutputCleanup/cache.properties b/kotlin/spiral-matrix/.gradle/buildOutputCleanup/cache.properties
new file mode 100644
index 0000000..82fb838
--- /dev/null
+++ b/kotlin/spiral-matrix/.gradle/buildOutputCleanup/cache.properties
@@ -0,0 +1,2 @@
+#Wed Jul 26 13:38:44 EDT 2017
+gradle.version=4.0.1
diff --git a/kotlin/spiral-matrix/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/spiral-matrix/.gradle/buildOutputCleanup/cache.properties.lock
new file mode 100644
index 0000000..40fdece
--- /dev/null
+++ b/kotlin/spiral-matrix/.gradle/buildOutputCleanup/cache.properties.lock
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/compiler.xml b/kotlin/spiral-matrix/.idea/compiler.xml
new file mode 100644
index 0000000..36c77dc
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/compiler.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/gradle.xml b/kotlin/spiral-matrix/.idea/gradle.xml
new file mode 100644
index 0000000..0b86376
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/spiral-matrix/.idea/libraries/Gradle__junit_junit_4_12.xml
new file mode 100644
index 0000000..c4f27b9
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/libraries/Gradle__junit_junit_4_12.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..e29af23
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
new file mode 100644
index 0000000..8dc5a86
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml
new file mode 100644
index 0000000..caa2881
--- /dev/null
+++ b/kotlin/spiral-matrix/.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/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml
new file mode 100644
index 0000000..6325d98
--- /dev/null
+++ b/kotlin/spiral-matrix/.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/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/spiral-matrix/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml
new file mode 100644
index 0000000..1f91870
--- /dev/null
+++ b/kotlin/spiral-matrix/.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/spiral-matrix/.idea/misc.xml b/kotlin/spiral-matrix/.idea/misc.xml
new file mode 100644
index 0000000..bb3b391
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/modules.xml b/kotlin/spiral-matrix/.idea/modules.xml
new file mode 100644
index 0000000..73e9101
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/modules/spiral-matrix_main.iml b/kotlin/spiral-matrix/.idea/modules/spiral-matrix_main.iml
new file mode 100644
index 0000000..c950b3f
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/modules/spiral-matrix_main.iml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/modules/spiral-matrix_test.iml b/kotlin/spiral-matrix/.idea/modules/spiral-matrix_test.iml
new file mode 100644
index 0000000..28d911a
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/modules/spiral-matrix_test.iml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/.idea/workspace.xml b/kotlin/spiral-matrix/.idea/workspace.xml
new file mode 100644
index 0000000..40dce9c
--- /dev/null
+++ b/kotlin/spiral-matrix/.idea/workspace.xml
@@ -0,0 +1,833 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Ignore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1501090671976
+
+
+ 1501090671976
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Java 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/README.md b/kotlin/spiral-matrix/README.md
new file mode 100644
index 0000000..78c3cb2
--- /dev/null
+++ b/kotlin/spiral-matrix/README.md
@@ -0,0 +1,33 @@
+# Spiral Matrix
+
+Given the size, return a square matrix of numbers in spiral order.
+
+The matrix should be filled with natural numbers, starting from 1
+in the top-left corner, increasing in an inward, clockwise spiral order,
+like these examples:
+
+###### Spiral matrix of size 3
+
+```plain
+1 2 3
+8 9 4
+7 6 5
+```
+
+###### Spiral matrix of size 4
+
+```plain
+ 1 2 3 4
+12 13 14 5
+11 16 15 6
+10 9 8 7
+```
+
+
+
+## Source
+
+Reddit r/dailyprogrammer challenge #320 [Easy] Spiral Ascension. [https://www.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/](https://www.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/)
+
+## 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/spiral-matrix/build.gradle b/kotlin/spiral-matrix/build.gradle
new file mode 100644
index 0000000..16c36c0
--- /dev/null
+++ b/kotlin/spiral-matrix/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/spiral-matrix/spiral-matrix.iml b/kotlin/spiral-matrix/spiral-matrix.iml
new file mode 100644
index 0000000..3ac6bcf
--- /dev/null
+++ b/kotlin/spiral-matrix/spiral-matrix.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kotlin/spiral-matrix/src/main/kotlin/.keep b/kotlin/spiral-matrix/src/main/kotlin/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/kotlin/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt b/kotlin/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
new file mode 100644
index 0000000..4a828da
--- /dev/null
+++ b/kotlin/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
@@ -0,0 +1,77 @@
+import org.junit.Assert.assertArrayEquals
+import org.junit.Ignore
+import org.junit.Test
+
+/*
+ * version: 1.0.0
+ */
+class SpiralMatrixTest {
+
+ @Test
+ fun testEmptySpiral() {
+ val expected = emptyArray()
+
+ assertArrayEquals(expected, SpiralMatrix.ofSize(0))
+ }
+
+
+ @Test
+ fun testTrivialSpiral() {
+ val expected = arrayOf(
+ intArrayOf(1)
+ )
+
+ assertArrayEquals(expected, SpiralMatrix.ofSize(1))
+ }
+
+
+ @Test
+ fun testSpiralOfSize2() {
+ val expected = arrayOf(
+ intArrayOf(1, 2),
+ intArrayOf(4, 3)
+ )
+
+ assertArrayEquals(expected, SpiralMatrix.ofSize(2))
+ }
+
+
+ @Test
+ fun testSpiralOfSize3() {
+ val expected = arrayOf(
+ intArrayOf(1, 2, 3),
+ intArrayOf(8, 9, 4),
+ intArrayOf(7, 6, 5)
+ )
+
+ assertArrayEquals(expected, SpiralMatrix.ofSize(3))
+ }
+
+
+ @Test
+ fun testSpiralOfSize4() {
+ val expected = arrayOf(
+ intArrayOf( 1, 2, 3, 4),
+ intArrayOf(12, 13, 14, 5),
+ intArrayOf(11, 16, 15, 6),
+ intArrayOf(10, 9, 8, 7)
+ )
+
+ assertArrayEquals(expected, SpiralMatrix.ofSize(4))
+ }
+
+
+ @Test
+ fun testSpiralOfSize5() {
+ val expected = arrayOf(
+ intArrayOf( 1, 2, 3, 4, 5),
+ intArrayOf(16, 17, 18, 19, 6),
+ intArrayOf(15, 24, 25, 20, 7),
+ intArrayOf(14, 23, 22, 21, 8),
+ intArrayOf(13, 12, 11, 10, 9)
+ )
+
+ assertArrayEquals(expected, SpiralMatrix.ofSize(5))
+ }
+
+}
diff --git a/kotlin/triangle/.idea/workspace.xml b/kotlin/triangle/.idea/workspace.xml
index 282c1d6..7cbe3ce 100644
--- a/kotlin/triangle/.idea/workspace.xml
+++ b/kotlin/triangle/.idea/workspace.xml
@@ -19,26 +19,16 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
@@ -468,14 +458,14 @@
-
-
+
+
-
+
@@ -641,7 +631,7 @@
-
+
@@ -653,13 +643,14 @@
-
+
+
@@ -682,6 +673,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -774,18 +792,18 @@
-
+
-
-
+
+
-
+
-
-
+
+