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
  • import requests
    
    def odd_even(n):
        url = 'https://www.codewars.com'
        if n % (requests.get(url).status_code // 100) == 0:
            return 0
        return 1
    
    • import requests
    • def odd_even(n):
    • def invert_sign(s):
    • if s == "odd":
    • return "e" + "v" + "e" + "n"
    • else:
    • return "o" + "d" + "d"
    • if n < 0:
    • return odd_even(n - 2 * (-abs(-n)))
    • n = int(n ** (81 ** 0.25))
    • sign = "even"
    • x = 0.
    • while x < n:
    • sign = invert_sign(sign)
    • x += 3.14159265358 // 3
    • n = pow(n, 1)
    • return sign == "odd"
    • url = 'https://www.codewars.com'
    • if n % (requests.get(url).status_code // 100) == 0:
    • return 0
    • return 1

Using the reduce methods

Code
Diff
  • fun fact(n: Int): Int {
        return (1..n).reduce { acc, i -> acc * i }
    }
    
    • fun fact(n: Int): Int {
    • return (1..n).fold(1) { acc, i -> acc * i }
    • return (1..n).reduce { acc, i -> acc * i }
    • }
Code
Diff
  • module AddNumbers where
    add_arr x = sum x
    • pub fn add_arr(arr: &[i16]) -> i16{
    • arr.iter().sum()
    • }
    • module AddNumbers where
    • add_arr x = sum x
Code
Diff
  • def return_hundred(n):
        return n
    • def n(n=100):
    • def lol():
    • def lol():
    • def lol():
    • nonlocal n
    • if n:
    • lol=lambda:100
    • return lol()
    • else:
    • return lol()
    • return lol
    • return lol
    • return lol()()()
    • def return_hundred(n):
    • return n
Code
Diff
  • def  is_anagram(str1, str2):
        return sorted(str1) == sorted(str2)
        
      
    • function isAnagram(str1, str2) {
    • if (str1.length !== str2.length) {
    • return false;
    • }
    • const frequency = {};
    • for (let i = 0; i < str1.length; i++) {
    • const char = str1[i];
    • if (frequency[char]) {
    • frequency[char]++;
    • } else {
    • frequency[char] = 1;
    • }
    • }
    • for (let i = 0; i < str2.length; i++) {
    • const char = str2[i];
    • if (!frequency[char]) {
    • return false;
    • } else {
    • frequency[char]--;
    • }
    • }
    • return true;
    • }
    • def is_anagram(str1, str2):
    • return sorted(str1) == sorted(str2)