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
  • add=lambda x:x #look at the test case
         
    • def add(*a):
    • return sum(a)
    • add=lambda x:x #look at the test case
Code
Diff
  • def multiply_and_add_one(a, b): return a*b + 1
    
    • def multiply_and_add_one(a, b):
    • return a*b + 1
    • def multiply_and_add_one(a, b): return a*b + 1
Code
Diff
  • module MaxNum (maxNum) where
    
    import Data.List
    import Data.Ord
    
    maxNum :: Int -> Int
    maxNum = read . sortOn Down . show
    • module MaxNum (maxNum) where
    • import Data.List
    • import Data.Ord
    • maxNum :: Int -> Int
    • maxNum = read . reverse . sort . show
    • maxNum = read . sortOn Down . show

Oh you know what? nevermind...

Code
Diff
  • slow_sum=sum
    • slow_sum=lambda l:sum(l)
    • slow_sum=sum

no need to assign strlen to a seperate variable, saved some cycles.

Code
Diff
  • #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
    
    char *fun(const char *input)
    {
      char *result = malloc(strlen(input) + 1);
      char *p      = result;
      while (*p++ = toupper(*input++));
      return result;
    }
    • #include <stdlib.h>
    • #include <string.h>
    • #include <ctype.h>
    • char *fun(const char *input) {
    • size_t len = strlen(input);
    • char *result = malloc(len + 1);
    • char *p = result;
    • while ((*p++ = toupper(*input++)));
    • return result;
    • char *fun(const char *input)
    • {
    • char *result = malloc(strlen(input) + 1);
    • char *p = result;
    • while (*p++ = toupper(*input++));
    • return result;
    • }
Code
Diff
  • _Bool above_two(int *arg)
    {
      return *arg > 2 ? 1 : (*arg = 3, 0);
    }
    • template<typename T>
    • bool above_two(T& arg){
    • static_assert(std::is_arithmetic<T>::value, "arg must be a arithmetic type");
    • if(arg <= T(2)){
    • arg = T(3);
    • }
    • return true;
    • _Bool above_two(int *arg)
    • {
    • return *arg > 2 ? 1 : (*arg = 3, 0);
    • }