From db539bca103bd6269e0a560631545b71b1da883b Mon Sep 17 00:00:00 2001 From: Adel Khaziakhmetov Date: Wed, 19 Feb 2025 20:13:24 +0300 Subject: [PATCH 1/2] adel khaziakhmetov home 1 --- src/main/kotlin/ru/otus/homework/fizzbuzz.kt | 17 +++++++++++++++-- src/main/kotlin/ru/otus/homework/sumoftwo.kt | 11 ++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/ru/otus/homework/fizzbuzz.kt b/src/main/kotlin/ru/otus/homework/fizzbuzz.kt index 6e04be1..f1e9a15 100644 --- a/src/main/kotlin/ru/otus/homework/fizzbuzz.kt +++ b/src/main/kotlin/ru/otus/homework/fizzbuzz.kt @@ -1,6 +1,19 @@ package ru.otus.homework +fun fizzbuzz(size: Int): Array { + val stringArray = Array(size) { "" } -fun fizzbuzz(n: Int): Array { - TODO("Выполните задание") + for(i in 0.., target: Int): Array { + for (i in 0.. Date: Wed, 19 Feb 2025 20:23:36 +0300 Subject: [PATCH 2/2] adel khaziakhmetov home 1 --- src/test/kotlin/ru/otus/homework/SumoftwoTest.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/kotlin/ru/otus/homework/SumoftwoTest.kt b/src/test/kotlin/ru/otus/homework/SumoftwoTest.kt index 2cc5d9d..8d4ee71 100644 --- a/src/test/kotlin/ru/otus/homework/SumoftwoTest.kt +++ b/src/test/kotlin/ru/otus/homework/SumoftwoTest.kt @@ -8,22 +8,22 @@ class SumoftwoTest { @Test fun `testcase 1`() { - val actual = sumOfTwo(intArrayOf(2, 7, 11, 15), 9) - val expected = intArrayOf(0, 1) + val actual = sumOfTwo(arrayOf(2, 7, 11, 15), 9) + val expected = arrayOf(0, 1) assertArrayEquals(expected, actual) } @Test fun `testcase 2`() { - val actual = sumOfTwo(intArrayOf(3, 2, 4), 6) - val expected = intArrayOf(1, 2) + val actual = sumOfTwo(arrayOf(3, 2, 4), 6) + val expected = arrayOf(1, 2) assertArrayEquals(expected, actual) } @Test fun `testcase 3`() { assertThrows { - sumOfTwo(intArrayOf(3, 2), 6) + sumOfTwo(arrayOf(3, 2), 6) } } } \ No newline at end of file