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
  • def devTwo(n, mod = False):
        return n // 2 if mod else n / 2
    • unsigned long long div2(unsigned long long a){
    • //Use binary operators...I-O
    • return a >> 1;
    • }
    • def devTwo(n, mod = False):
    • return n // 2 if mod else n / 2
Code
Diff
  • def even_or_odd(number):
        l={0:"Even",1:"Odd"}
        return l[number%2]
    • def even_or_odd(number):
    • #good luck
    • l={0:"Even",1:"Odd"}
    • return l[number%2]
Code
Diff
  • #include<iostream>
    
    int doubleValue(int x) {
        return x/0.5;
    }
    
    • #include<iostream>
    • int doubleValue(int x) {
    • return x * 2;
    • return x/0.5;
    • }

#include
using namespace std;

int faiAddizione(int x, int y);
int faiSottrazione(int x, int y);
int faiMoltiplicazione(int x, int y);
int faiDivisione(int x, int y);
int faiModulus(int x, int y);

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)

switch(choice){
    case 1 : cout << faiAddizione(x, y);
      break;
    case 2 : cout << faiSottrazione(x, y);
      break;
    case 3 : cout << faiMoltiplicazione(x, y);
      break;
    case 4 : cout << faiDivisione(x, y);
      break;
    case 5 : cout << faiModulus(x,y);
      break;
    default : die();
}

// Instead of cout << x + y << endl; for example, do return (x + y);
// You can call the die function with die();

}

int faiAddizione(int x, int y)
{ return (x + y);

}

int faiSottrazione(int x, int y){
return (x - y);

}

int faiDivisione(int x, int y){
if(y != 0){
return (x/y);
}
else
{
die();
return 0;
}
}

int faiMoltiplicazione(int x, int y){
return (x * y);
}

int faiModulus(int x, int y){
return (x % y);
}

Code
Diff
  • #include <iostream>
    using namespace std;
    
    int faiAddizione(int x, int y);
    int faiSottrazione(int x, int y);
    int faiMoltiplicazione(int x, int y);
    int faiDivisione(int x, int y);
    int faiModulus(int x, int y);  
    
    
    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)
        
        switch(choice){
            case 1 : cout << faiAddizione(x, y);
              break;
            case 2 : cout << faiSottrazione(x, y);
              break;
            case 3 : cout << faiMoltiplicazione(x, y);
              break;
            case 4 : cout << faiDivisione(x, y);
              break;
            case 5 : cout << faiModulus(x,y);
              break;
            default : return die();
                break;
        }
    }  
    
    
    int faiAddizione(int x, int y)
      { return (x + y);
      
    }
    
    int faiSottrazione(int x, int y){
      return (x - y);
      
    }
    
      
      int faiDivisione(int x, int y){
      if(y != 0){
        return (x/y);
      }
      else
      {
        die();
        return 0;
      }
    }
    
      
      int faiMoltiplicazione(int x, int y){
      return (x * y); 
    }
    
      
      int faiModulus(int x, int y){
      return (x % y);
    }
    
    • #include <iostream>
    • using namespace std;
    • int faiAddizione(int x, int y);
    • int faiSottrazione(int x, int y);
    • int faiMoltiplicazione(int x, int y);
    • int faiDivisione(int x, int y);
    • int faiModulus(int x, int y);
    • 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();
    • }
    • switch(choice){
    • case 1 : cout << faiAddizione(x, y);
    • break;
    • case 2 : cout << faiSottrazione(x, y);
    • break;
    • case 3 : cout << faiMoltiplicazione(x, y);
    • break;
    • case 4 : cout << faiDivisione(x, y);
    • break;
    • case 5 : cout << faiModulus(x,y);
    • break;
    • default : return die();
    • break;
    • }
    • }
    • int faiAddizione(int x, int y)
    • { return (x + y);
    • }
    • int faiSottrazione(int x, int y){
    • return (x - y);
    • }
    • int faiDivisione(int x, int y){
    • if(y != 0){
    • return (x/y);
    • }
    • else
    • {
    • die();
    • return 0;
    • }
    • }
    • int faiMoltiplicazione(int x, int y){
    • return (x * y);
    • }
    • int faiModulus(int x, int y){
    • return (x % y);
    • }
Code
Diff
  • var Greet = () => "Hello World!"
     
    
    • function Greet(){return "Hello World!"}
    • var Greet = () => "Hello World!"
Code
Diff
  • for(let i = 0; i < 10; i++) console.log("Matthew is gay");
    • var b = 5;
    • var a = 6;
    • do {
    • console.log("Matthew is gay");
    • a++;
    • } while(a<16);
    • for(let i = 0; i < 10; i++) console.log("Matthew is gay");
Code
Diff
  • print("Hello ", "word") #p fix the cde dumbfuck
    • print("Hello", "word") #p fix the cde dumbfuck
    • print("Hello ", "word") #p fix the cde dumbfuck

Simplified prior code.

Code
Diff
  • function factorial (n) {
      return (n !== 0 && n !== 1) ? (n * factorial(n - 1)) : 1 
    }
    • function factorial (n) {
    • if (n === 0 || n === 1) {
    • return 1;
    • } else {
    • return n * factorial(n - 1);
    • }
    • return (n !== 0 && n !== 1) ? (n * factorial(n - 1)) : 1
    • }
Code
Diff
  • fn flip_the_number(x: &u64) -> u64 {
        x.to_string().chars().rev().collect::<String>().parse().unwrap()
    }
    • fn flip_the_number(x: &u64) -> u64 {
    • let mut x = *x;
    • let mut y = 0;
    • while x != 0 {
    • y = y * 10 + x % 10;
    • x /= 10;
    • }
    • y
    • x.to_string().chars().rev().collect::<String>().parse().unwrap()
    • }
Code
Diff
  • def kube(x, y, z):
        #your code here
        return x*y*z
    • def kube(x, y, z):
    • #your code here
    • return 0
    • return x*y*z