diff --git a/kotlin/diamond/.gradle/3.5-rc-2/file-changes/last-build.bin b/kotlin/diamond/.gradle/3.5-rc-2/file-changes/last-build.bin
deleted file mode 100644
index f76dd23..0000000
Binary files a/kotlin/diamond/.gradle/3.5-rc-2/file-changes/last-build.bin and /dev/null differ
diff --git a/kotlin/diamond/.gradle/3.5-rc-2/taskHistory/taskHistory.lock b/kotlin/diamond/.gradle/3.5-rc-2/taskHistory/taskHistory.lock
deleted file mode 100644
index 87133cc..0000000
Binary files a/kotlin/diamond/.gradle/3.5-rc-2/taskHistory/taskHistory.lock and /dev/null differ
diff --git a/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.bin b/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.bin
index d49c61a..f78dce1 100644
Binary files a/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.bin and b/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.bin differ
diff --git a/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.lock b/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.lock
index db68580..3311807 100644
Binary files a/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.lock and b/kotlin/diamond/.gradle/4.0.1/fileHashes/fileHashes.lock differ
diff --git a/kotlin/diamond/.gradle/buildOutputCleanup/cache.properties b/kotlin/diamond/.gradle/buildOutputCleanup/cache.properties
index 77367f7..dea8164 100644
--- a/kotlin/diamond/.gradle/buildOutputCleanup/cache.properties
+++ b/kotlin/diamond/.gradle/buildOutputCleanup/cache.properties
@@ -1,2 +1,2 @@
-#Sun Jul 23 23:51:11 EDT 2017
-gradle.version=3.5-rc-2
+#Tue Jul 25 10:54:12 EDT 2017
+gradle.version=4.0.1
diff --git a/kotlin/diamond/.idea/compiler.xml b/kotlin/diamond/.idea/compiler.xml
deleted file mode 100644
index df7387d..0000000
--- a/kotlin/diamond/.idea/compiler.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/encodings.xml b/kotlin/diamond/.idea/encodings.xml
deleted file mode 100644
index 97626ba..0000000
--- a/kotlin/diamond/.idea/encodings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/gradle.xml b/kotlin/diamond/.idea/gradle.xml
deleted file mode 100644
index 03a1ee5..0000000
--- a/kotlin/diamond/.idea/gradle.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/diamond/.idea/libraries/Gradle__junit_junit_4_12.xml
deleted file mode 100644
index c4f27b9..0000000
--- a/kotlin/diamond/.idea/libraries/Gradle__junit_junit_4_12.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/diamond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
deleted file mode 100644
index e29af23..0000000
--- a/kotlin/diamond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
deleted file mode 100644
index 8dc5a86..0000000
--- a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml
deleted file mode 100644
index caa2881..0000000
--- a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml
deleted file mode 100644
index 6325d98..0000000
--- a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml
deleted file mode 100644
index 1f91870..0000000
--- a/kotlin/diamond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/misc.xml b/kotlin/diamond/.idea/misc.xml
deleted file mode 100644
index bd152bd..0000000
--- a/kotlin/diamond/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/modules.xml b/kotlin/diamond/.idea/modules.xml
deleted file mode 100644
index 926ecad..0000000
--- a/kotlin/diamond/.idea/modules.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/modules/diamond_main.iml b/kotlin/diamond/.idea/modules/diamond_main.iml
deleted file mode 100644
index 0767cbd..0000000
--- a/kotlin/diamond/.idea/modules/diamond_main.iml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/modules/diamond_test.iml b/kotlin/diamond/.idea/modules/diamond_test.iml
deleted file mode 100644
index 6d025ae..0000000
--- a/kotlin/diamond/.idea/modules/diamond_test.iml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/.idea/workspace.xml b/kotlin/diamond/.idea/workspace.xml
deleted file mode 100644
index f9a717c..0000000
--- a/kotlin/diamond/.idea/workspace.xml
+++ /dev/null
@@ -1,703 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- DEFINITION_ORDER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1500868261705
-
-
- 1500868261705
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/kotlin/diamond/out/production/classes/DiamondPrinter.class b/kotlin/diamond/out/production/classes/DiamondPrinter.class
index 29bfe55..9906e27 100644
Binary files a/kotlin/diamond/out/production/classes/DiamondPrinter.class and b/kotlin/diamond/out/production/classes/DiamondPrinter.class differ
diff --git a/kotlin/diamond/out/test/classes/DiamondPrinterTest.class b/kotlin/diamond/out/test/classes/DiamondPrinterTest.class
index be614d2..9d98c8c 100644
Binary files a/kotlin/diamond/out/test/classes/DiamondPrinterTest.class and b/kotlin/diamond/out/test/classes/DiamondPrinterTest.class differ
diff --git a/kotlin/diamond/src/main/kotlin/DiamondPrinter.kt b/kotlin/diamond/src/main/kotlin/DiamondPrinter.kt
index 7be6d6b..e9bc4c4 100644
--- a/kotlin/diamond/src/main/kotlin/DiamondPrinter.kt
+++ b/kotlin/diamond/src/main/kotlin/DiamondPrinter.kt
@@ -7,18 +7,27 @@ class DiamondPrinter {
for (i in 0..length - 1){
val testChar: Char = charList[i]
val totalLength: Int = (length * 2) - 1
- val beforeSpaces: Int = length - i
- val middleSpaces: Int = if (totalLength - ((beforeSpaces * 2) + 1) > 0){
- totalLength - ((beforeSpaces * 2) + 1)
- } else {0}
val builder = StringBuilder()
- builder.append(CharArray(beforeSpaces, {' '}))
- .append(testChar)
- .append(CharArray(middleSpaces, {' '}))
- .append(testChar)
- .append(CharArray(beforeSpaces, {' '}))
- returnList.add(String(builder))
+ if (testChar == 'A'){
+ val beforeSpaces: Int = length - 1
+
+ builder.append(CharArray(beforeSpaces, {' '}))
+ .append(testChar)
+ .append(CharArray(beforeSpaces, {' '}))
+ } else {
+ val beforeSpaces: Int = length - i - 1
+ val middleSpaces: Int = totalLength - (beforeSpaces * 2) - 2
+
+ builder.append(CharArray(beforeSpaces, {' '}))
+ .append(testChar)
+ .append(CharArray(middleSpaces, {' '}))
+ .append(testChar)
+ .append(CharArray(beforeSpaces, {' '}))
+ }
+ returnList.add(index = (returnList.size/2), element = String(builder))
+ returnList.add(index = (returnList.size/2), element = String(builder))
}
+ returnList.removeAt(returnList.size/2)
return returnList
}
}
\ No newline at end of file
diff --git a/kotlin/diamond/src/test/kotlin/DiamondPrinterTest.kt b/kotlin/diamond/src/test/kotlin/DiamondPrinterTest.kt
index 2a563b6..c9125ce 100644
--- a/kotlin/diamond/src/test/kotlin/DiamondPrinterTest.kt
+++ b/kotlin/diamond/src/test/kotlin/DiamondPrinterTest.kt
@@ -22,7 +22,6 @@ class DiamondPrinterTest {
assertThat(output, `is`(listOf("A")))
}
- @Ignore
@Test
fun testTwoByTwoDiamond() {
val output = diamondPrinter.printToList('B')
@@ -32,7 +31,6 @@ class DiamondPrinterTest {
" A ")))
}
- @Ignore
@Test
fun testThreeByThreeDiamond() {
val output = diamondPrinter.printToList('C')
@@ -44,7 +42,6 @@ class DiamondPrinterTest {
" A ")))
}
- @Ignore
@Test
fun testFiveByFiveDiamond() {
val output = diamondPrinter.printToList('E')
@@ -60,7 +57,6 @@ class DiamondPrinterTest {
" A ")))
}
- @Ignore
@Test
fun testFullDiamond() {
val output = diamondPrinter.printToList('Z')