Start a new Kumite
AllAgda (Beta)BF (Beta)CCFML (Beta)ClojureCOBOL (Beta)CoffeeScriptCommonLisp (Beta)CoqC++CrystalC#D (Beta)DartElixirElm (Beta)Erlang (Beta)Factor (Beta)Forth (Beta)Fortran (Beta)F#GoGroovyHaskellHaxe (Beta)Idris (Beta)JavaJavaScriptJulia (Beta)Kotlinλ Calculus (Beta)LeanLuaNASMNim (Beta)Objective-C (Beta)OCaml (Beta)Pascal (Beta)Perl (Beta)PHPPowerShell (Beta)Prolog (Beta)PureScript (Beta)PythonR (Beta)RacketRaku (Beta)Reason (Beta)RISC-V (Beta)RubyRustScalaShellSolidity (Beta)SQLSwiftTypeScriptVB (Beta)
Show only mine

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.

Ad
Ad
Code
Diff
  • 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
Code
Diff
  • interface Kumite {
      static boolean hasThree(int x) {
        return x % 10 == 3 ? true : x < 10 ? false: hasThree(x/10);
      }
    }
    • interface Kumite {
    • static boolean hasThree(int x) {
    • return (x + "").contains("3") ;
    • return x % 10 == 3 ? true : x < 10 ? false: hasThree(x/10);
    • }
    • }
Code
Diff
  • theletterh=lambda x:"".join("H" for _ in range(x))
    • "H".__mul__
    • theletterh=lambda x:"".join("H" for _ in range(x))
Code
Diff
  • // 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
Mathematics
Code
Diff
  • 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);
    • }