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 compute() {
      return 2;
    }
    • function compute() {
    • return 1;
    • return 2;
    • }

It's easier ;-)

Code
Diff
  • intertwine=a=> a.split('').sort().join('')
    • intertwine=a=>[...a.slice(-a.length/2)].map((e,i)=>a[i]+e).join``
    • intertwine=a=> a.split('').sort().join('')
Code
Diff
  • d=lambda x:d(x//10)+x%10 if x>9 else x
    a=lambda m,s,p:d(m)<d(s)+d(p)
    • d,a=lambda n:sum(int(c) for c in str(n)),lambda m,s,p:d(m)<d(s)+d(p)
    • d=lambda x:d(x//10)+x%10 if x>9 else x
    • a=lambda m,s,p:d(m)<d(s)+d(p)

This is a code golf site now.

Code
Diff
  • s=lambda l:l if len(l)<3else[l[0],l[-1]]+s(l[1:-1])
    • def special_sort(list):
    • r = []
    • l = len(list)
    • for i in range(l // 2 + 1):
    • if i == 0 or (i == l // 2 and not l % 2):
    • r.append(list[i])
    • else: r.extend([list[-i], list[i]])
    • return r
    • s=lambda l:l if len(l)<3else[l[0],l[-1]]+s(l[1:-1])
Code
Diff
  • class Kata{
      
      public static Boolean verifySum(String nameOne, String nameTwo) {
            int sumOfNames = 0;
    
            if (nameOne == null || nameTwo == null) {
                return null;
            }
    
            for (char ch : nameOne.toCharArray()){
                sumOfNames += ch;
            }
    
            for (char ch : nameTwo.toCharArray()){
                sumOfNames -= ch;
            }
    
            return sumOfNames == 0;
        }
    }
    • class Kata{
    • public static String verifySum(String nameOne, String nameTwo) {
    • int[] sumOfNames = new int[]{0, 0};
    • public static Boolean verifySum(String nameOne, String nameTwo) {
    • int sumOfNames = 0;
    • if (nameOne == null || nameTwo == null) {
    • return "NULL";
    • return null;
    • }
    • for (int i = 0; i < nameOne.length(); i++){
    • sumOfNames[0] += nameOne.charAt(i);
    • for (char ch : nameOne.toCharArray()){
    • sumOfNames += ch;
    • }
    • for (int i = 0; i < nameTwo.length(); i++){
    • sumOfNames[1] += nameTwo.charAt(i);
    • for (char ch : nameTwo.toCharArray()){
    • sumOfNames -= ch;
    • }
    • return sumOfNames[0] == sumOfNames[1] ? "TRUE" : "FALSE";
    • return sumOfNames == 0;
    • }
    • }
Arrays
Data Types
Code
Diff
  • def printArray(arr):
        yield from arr
    • def printArray(arr):
    • for i in arr:
    • yield i
    • yield from arr