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
  • -- Code here
    SELECT * FROM CUSTOMERS
    • -- Code here
    • SELECT * FROM CUSTOMERS
Code
Diff
  • returnInputNumber = n => typeof n === "number" ? n : 0
    • const returnInputNumber = (n = 0) => {
    • return typeof n === "number" ? n : 0;
    • };
    • returnInputNumber = n => typeof n === "number" ? n : 0
Code
Diff
  • def Calculator(c = "+", a = 0, b = 1):
        try: return eval(str(a) + c + str(b))
        except: return 0
    • #include <iostream>
    • using namespace std;
    • string die() {
    • return "Invalid Input!";
    • }
    • string Calculator(int choice, int x, int y) {
    • cout << "Welcome to simple calculator!\n";
    • cout << "1. Addition\n2. Subtraction\n3. Multiplication\n4. Division\n5. Modulus\n";
    • // YOU: Write code to finish this program (Input is given, don't use cin)
    • // Instead of cout << x + y << endl; for example, do return (x + y);
    • // You can call the die function with die();
    • }
    • def Calculator(c = "+", a = 0, b = 1):
    • try: return eval(str(a) + c + str(b))
    • except: return 0
Code
Diff
  • #include<iostream>
    
    int doubleValue(int x) {
        return x + x;
    }
    
    • #include<iostream>
    • int doubleValue(int x) {
    • return x * 2;
    • return x + x;
    • }

Function names should start with lower case.
const should be used instead of var since the function isn't changing.

Code
Diff
  • const greet = () => "Hello World!";
    • function Greet(){return "Hello World!"}
    • const greet = () => "Hello World!";
Code
Diff
  • float AreaOfTriangle(float w, float h) {return (w * h) * 0.5;} //Get one-lined
    • float AreaOfTriangle(float w, float h) {return (w * h) / 2;} //Get one-lined
    • float AreaOfTriangle(float w, float h) {return (w * h) * 0.5;} //Get one-lined

Can be moved onto a single line since its a lambda operation.

Code
Diff
  • public class Kumite {
      public static bool IsThree(int x) => x.ToString().Contains('3');
    }
    • public class Kumite {
    • public static bool IsThree(int x) =>
    • x.ToString().Contains('3');
    • public static bool IsThree(int x) => x.ToString().Contains('3');
    • }
Code
Diff
  • const removeEveryThird =  str => (str[0] || '') + str.slice(1).replace(/(..)./g, '$1')
    • function removeEveryThird(str) {
    • return (str[0] || '') + str
    • .slice(1)
    • .replace(/(..)./g, '$1')
    • }
    • const removeEveryThird = str => (str[0] || '') + str.slice(1).replace(/(..)./g, '$1')