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
  • const tab = (func, start, end, step) => {
      let sum = 0;
      const count = Math.ceil((end - start) / step) + 1;
      for (let i = 0; i < count; i++) {
        sum += func(start + i * step);
      }
      return sum;
    }
    • const tab = (f, a, b, h) => {
    • return Array.from(
    • {
    • length: Math.ceil((b - a) / h) + 1
    • },
    • (v, i) => f(a + (i * h))).reduce((a, c) => a += c, 0
    • )
    • }
    • const tab = (func, start, end, step) => {
    • let sum = 0;
    • const count = Math.ceil((end - start) / step) + 1;
    • for (let i = 0; i < count; i++) {
    • sum += func(start + i * step);
    • }
    • return sum;
    • }
Code
Diff
  • #include <stdbool.h>
    
    bool odd_even(int n)
    {
        return n < 0 || n > 1 ? odd_even(n + 2 * (n < 0 ? 1 : -1)) : !n;
    }
    • #include <stdbool.h>
    • bool odd_even(int n)
    • {
    • int r = 0, p[1] = {0};
    • goto owo;
    • uwu:
    • *&*p = (&r)[0];
    • goto miau;
    • owo:
    • *(int*)((void*)&r) = n%2;
    • goto uwu;
    • miau:
    • return !(*p&1) ? true : false;
    • return n < 0 || n > 1 ? odd_even(n + 2 * (n < 0 ? 1 : -1)) : !n;
    • }
Code
Diff
  • #include <stdlib.h>
    #include <string.h>
    
    char *fanis(char *r, int k) {
        char *w = malloc(strlen(r) + 1), *p = w;
        while(w && *r) *p++ = k + *r++;
        return w;
    }
    • #include <stdlib.h>
    • #include <string.h>
    • char *fanis(char* r, int k) {
    • char *w = malloc(strlen(r)+1);
    • if (!w)
    • char *fanis(char *r, int k) {
    • char *w = malloc(strlen(r) + 1), *p = w;
    • while(w && *r) *p++ = k + *r++;
    • return w;
    • char *p = w;
    • while (*r)
    • *p++ = k + *r++;
    • return w;
    • }
Code
Diff
  • hello_world=lambda world: "No "*(not world) + "Hello "*world + "World" + " baby"*world
    • hello_world=lambda world: "No "*(1-world) + "Hello "*world + "World" + " baby"*world
    • hello_world=lambda world: "No "*(not world) + "Hello "*world + "World" + " baby"*world
Code
Diff
  • using System;
    
    public static class Kata
    {
        public static int SameCase(char a, char b)
        {
            var aZ = a <= 'Z';
            var bZ = b <= 'Z';
            var aIsLetter = a >= 'A' && a <= 'z' && (aZ || a >= 'a');
            if (aIsLetter != (b >= 'A' && b <= 'z' && (bZ || b >= 'a'))) return -1;
            return (!aIsLetter || aZ == bZ) ? 1 : 0;
        }
    }
    • using System;
    • public static class Kata
    • {
    • public static int SameCase(char a, char b)
    • {
    • if (!char.IsLetter(a) && !char.IsLetter(b))
    • return 1;
    • if (!char.IsLetter(a) || !char.IsLetter(b))
    • return -1;
    • return (char.IsUpper(a) == char.IsUpper(b)) ? 1 : 0;
    • var aZ = a <= 'Z';
    • var bZ = b <= 'Z';
    • var aIsLetter = a >= 'A' && a <= 'z' && (aZ || a >= 'a');
    • if (aIsLetter != (b >= 'A' && b <= 'z' && (bZ || b >= 'a'))) return -1;
    • return (!aIsLetter || aZ == bZ) ? 1 : 0;
    • }
    • }