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
  • function rubegoldberg(): bool {
        return true;
    }
    • function rubegoldberg(){return __LINE__;}
    • function rubegoldberg(): bool {
    • return true;
    • }
Code
Diff
  • squared=n=>n/(1/n)
    • squared
    • =(a,i=2,r=1)=>
    • i?squared(a,i-1,r*a):r
    • squared=n=>n/(1/n)
Code
Diff
  • isDivisible = (n, x, y) => n % x == 0 && n % y == 0;
    
    • const isDivisible = (n, x, y) => n % x == 0 && n % y == 0;
    • isDivisible = (n, x, y) => n % x == 0 && n % y == 0;
Code
Diff
  • power = lambda num, p: num ** p
    • def power(num, p):
    • return num ** p
    • power = lambda num, p: num ** p
Code
Diff
  • public class FizzBuzz
    {
        public string GetOutput(int number) =>
          number % 3 == 0 && number % 5 == 0 ? "FizzBuzz" : number % 3 == 0 ? "Fizz" : number % 5 == 0 ? "Buzz" : number.ToString();
        
    }
    • public class FizzBuzz
    • {
    • public string GetOutput(int number)
    • {
    • if (number % 3 == 0 && number % 5 == 0)
    • {
    • return "FizzBuzz";
    • }
    • if (number % 3 == 0)
    • {
    • return "Fizz";
    • }
    • if (number % 5 == 0)
    • {
    • return "Buzz";
    • }
    • return number.ToString();
    • }
    • public string GetOutput(int number) =>
    • number % 3 == 0 && number % 5 == 0 ? "FizzBuzz" : number % 3 == 0 ? "Fizz" : number % 5 == 0 ? "Buzz" : number.ToString();
    • }
Code
Diff
  • power=(n,p)=> p == 0 ? 1 : n**p
    • power=(n,p)=> p === 0 ? 1 : Math.pow(n,p)
    • power=(n,p)=> p == 0 ? 1 : n**p
Code
Diff
  • const countVowel = s => s.split(/[aeiou]/i).length-1
      
    • const countVowel = s => s.match(/[aeiou]/gi)?.length | 0
    • const countVowel = s => s.split(/[aeiou]/i).length-1
Code
Diff
  • def remove(lst, excluded):
        excluded = frozenset(excluded)
        return list(filter(lambda x: x not in excluded, lst))
    • def remove(integers, values):
    • return list(filter(lambda x: x not in values,integers))
    • def remove(lst, excluded):
    • excluded = frozenset(excluded)
    • return list(filter(lambda x: x not in excluded, lst))
Code
Diff
  • package kumite
    
    import "time"
    
    func CheckWorkHours(dateTime time.Time) bool {
      const (
        monday,  friday  = 1, 5
        morning, evening = 8, 18
      )
      
      day, hour := dateTime.Weekday(), dateTime.Hour()
      
      return monday <= day && day <= friday && morning <= hour && hour < evening
    }
    
    • package kumite
    • import "time"
    • func CheckWorkHours(dateTime time.Time) bool {
    • // It's better to have constants for work interval
    • const (
    • WK_HOUR_BEGIN = 8
    • WK_HOUR_END = 18
    • WK_DAY_BEGIN = 1
    • WK_DAY_END = 6
    • monday, friday = 1, 5
    • morning, evening = 8, 18
    • )
    • hour := dateTime.Hour()
    • day := dateTime.Weekday()
    • day, hour := dateTime.Weekday(), dateTime.Hour()
    • return WK_DAY_BEGIN <= day && day < WK_DAY_END && WK_HOUR_BEGIN <= hour && hour < WK_HOUR_END
    • return monday <= day && day <= friday && morning <= hour && hour < evening
    • }