Kumite (ko͞omiˌtā) is the practice of taking techniques learned from Kata and applying them through the act of freestyle sparring.
You can create a new kumite by providing some initial code and optionally some test cases. From there other warriors can spar with you, by enhancing, refactoring and translating your code. There is no limit to how many warriors you can spar with.
A great use for kumite is to begin an idea for a kata as one. You can collaborate with other code warriors until you have it right, then you can convert it to a kata.
object FindMultiples: def findMultiples(n: Int): Int = Seq.range(0, n).filter(i => i % 4 == 0 || i % 6 == 0).sum
- object FindMultiples:
- def findMultiples(n: Int): Int =
(for (i <- 0 until n by 2 if i % 4 == 0 || i % 6 == 0) yield i).sum- Seq.range(0, n).filter(i => i % 4 == 0 || i % 6 == 0).sum
theletterh=lambda x:"".join("H" for _ in range(x))
"H".__mul__- theletterh=lambda x:"".join("H" for _ in range(x))
import codewars_test as test import solution # H # H @test.describe("The H") def test_group(): @test.it("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\nH \nHHHHH") def test_case(): test.assert_equals(theletterh(3), 'HHH') test.assert_equals(theletterh(0), '') test.assert_equals(theletterh(1), 'H') test.assert_equals(theletterh(13), 'HHHHHHHHHHHHH')
- import codewars_test as test
- import solution # H
- # H
- @test.describe("The H")
- def test_group():
- @test.it("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\nH \nHHHHH")
- def test_case():
- test.assert_equals(theletterh(3), 'HHH')
- test.assert_equals(theletterh(0), '')
- test.assert_equals(theletterh(1), 'H')
- test.assert_equals(theletterh(13), 'HHHHHHHHHHHHH')
// https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum.html
import java.util.Arrays;public class Adder{public static int AddAllContent(int[] numbersToAdd){return Arrays.stream(numbersToAdd).sum();}}- // https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum.html
import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test class SolutionTest { @Test fun sample() { assertEquals(6, intArrayOf(1,2,3).sum()) assertEquals(16, intArrayOf(1,2,3,10).sum()) assertEquals(27, intArrayOf(4,7,6,10).sum()) } }
import org.junit.jupiter.api.Test;import static org.junit.jupiter.api.Assertions.assertEquals;// TODO: Replace examples and use TDD by writing your own tests- import org.junit.jupiter.api.Assertions.*
- import org.junit.jupiter.api.Test
- class SolutionTest {
@Testvoid testSomething() {int[] numbers = {1,2,3};assertEquals(Adder.AddAllContent(numbers), 6);}@Testvoid testSomethingElse() {int[] numbers = {1,2,3, 10};assertEquals(Adder.AddAllContent(numbers), 16);}@Testvoid testSomethingMore() {int[] numbers = {4,7,6,10};assertEquals(Adder.AddAllContent(numbers), 27);}}- @Test
- fun sample() {
- assertEquals(6, intArrayOf(1,2,3).sum())
- assertEquals(16, intArrayOf(1,2,3,10).sum())
- assertEquals(27, intArrayOf(4,7,6,10).sum())
- }
- }
function calcTokenCost($price, $token) { return max($token, $price ? (int) $token * round($price / $token) : 0); }
- function calcTokenCost($price, $token) {
return max([$token, $token ? $token * round($price / $token) : $token]);- return max($token, $price ? (int) $token * round($price / $token) : 0);
- }