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
  • print ('hello world')
    • print ('hello world)
    • print ('hello world')
Code
Diff
  • def prime(x):
        if x <= 1:
            return False
        for i in range(2,int(x/2)):
            if x % i is 0:
                return False
        return True
    • def prime(x):
    • counter = 0
    • for i in range(1,x):
    • if x <= 1:
    • return False
    • for i in range(2,int(x/2)):
    • if x % i is 0:
    • counter += 1
    • if counter is 0:
    • return True
    • else:
    • return False
    • return False
    • return True
Code
Diff
  • "Hello PowerShell!"
    • #!/bin/bash
    • STR="Hello Bash!"
    • echo $STR
    • "Hello PowerShell!"
Code
Diff
  • public class AbbreviateTwoWords {
    
      public static String abbrevName(String name) {
       
        return name.replaceAll("[^A-Z\\s]","").replaceAll("\\s",".");
      }
    }
    • public class AbbreviateTwoWords {
    • public static String abbrevName(String name) {
    • String[] names = name.split(" ");
    • return (names[0].charAt(0) + "." + names[1].charAt(0)).toUpperCase();
    • return name.replaceAll("[^A-Z\\s]","").replaceAll("\\s",".");
    • }
    • }

your solution in one line

Code
Diff
  • divisibility_by_3 = lambda x: sum(int(d) for d in str(x)) % 3 == 0
    • def divisibility_by_3(x):
    • list_of_values = [int(d) for d in str(x)]
    • summation = sum(list_of_values)
    • if summation % 3 == 0:
    • return True
    • else:
    • return False
    • divisibility_by_3 = lambda x: sum(int(d) for d in str(x)) % 3 == 0
Code
Diff
  • # only works with strings, but five times faster than the original solution
    import re
    def unique_in_order(iterable):
        return re.findall(r'(.)(?!\1)', iterable)
    • # only works with strings, but five times faster than the original solution
    • import re
    • def unique_in_order(iterable):
    • iterable = list(iterable)
    • while 1==1:
    • for x in range(len(iterable)):
    • if iterable[x]==iterable[x-1]:
    • del iterable[x]
    • break
    • if x==len(iterable)-1:
    • return iterable
    • return re.findall(r'(.)(?!\1)', iterable)
Arrays
Data Types

BEHOLD THE ALMIGHTY :

Code
Diff
  • public class myWorld{
      public static void printArray(int[] arr){
        for(int i : arr)
          System.out.println(i);
      }
    }
    • public class myWorld{
    • public void printArray(int[] arr){
    • for(int i = 0; i < arr.length; i++){
    • System.out.println(arr[i]);
    • }
    • public static void printArray(int[] arr){
    • for(int i : arr)
    • System.out.println(i);
    • }
    • }
Code
Diff
  • with(`                                    `)
    with(0b1101110100)
    ({}).__proto__[toString(length)]=_=>toString(length)
    • //return string that says the word ok
    • with(` `)
    • with(0b1101110100)
    • ({}).__proto__[toString(length)]=_=>toString(length)

It works once every hour :)

Code
Diff
  • function returnhundred() {
      return new Date().getMinutes() + new Date().getMinutes() + new Date().getMinutes() + new Date().getMinutes();
    }
    • function returnhundred() {
    • return 10 ** 2;
    • return new Date().getMinutes() + new Date().getMinutes() + new Date().getMinutes() + new Date().getMinutes();
    • }