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.

Code
Diff
  • from functools import reduce
    from operator import __mul__
    def prod(numbers):
        return reduce(__mul__, numbers) if numbers else 0
    • from functools import reduce
    • from operator import __mul__
    • def prod(numbers):
    • if numbers == []: return 0
    • product = 1
    • for number in numbers:
    • product *= number
    • return product
    • return reduce(__mul__, numbers) if numbers else 0
Code
Diff
  • public class NthFib {
      public static final double phi = (1 + Math.sqrt(5))/2.0;
      
      public static int fib(int n) {
        return (int)Math.round(Math.pow(phi, n)/Math.sqrt(5));
      }
    }
    
    • public class NthFib {
    • public static final double phi = (1 + Math.sqrt(5))/2.0;
    • public static final double psi = (1 - Math.sqrt(5))/2.0;
    • public static int fib(int n) {
    • return (int)((Math.pow(phi, n) - Math.pow(psi, n))/Math.sqrt(5));
    • return (int)Math.round(Math.pow(phi, n)/Math.sqrt(5));
    • }
    • }
Mathematics
Algorithms
Logic
Numbers
Code
Diff
  • function getResult(array, operator) {
       test :D
    }
    • function getResult(array, operator) {
    • //Good luck!
    • test :D
    • }
Code
Diff
  • int nbDaysInMonth(int n, bool m) {  
    	return n>7?31-n%2:n==2?31-3+m:31-1+n%2; //lets introduce some obfuscation:)
    }
    • int nbDaysInMonth(int n, bool m) {
    • return n == 2 ? 28 + m : 30 + (n + (n > 7) & 1);
    • int nbDaysInMonth(int n, bool m) {
    • return n>7?31-n%2:n==2?31-3+m:31-1+n%2; //lets introduce some obfuscation:)
    • }
Code
Diff
  • def flip_the_number(n) : return int(str(n)[::-1])
    • def flip_the_number(n):
    • return int(f'{n}'[::-1])
    • def flip_the_number(n) : return int(str(n)[::-1])

Now with tests shipped.

Code
Diff
  • const returnAscending = (...args) => args.sort((a,b)=> a-b ).join('');
    • const returnAscending = (...args) => args.sort(function(a,b){return a-b }).join('');
    • const returnAscending = (...args) => args.sort((a,b)=> a-b ).join('');