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
  • from math import prod
    
    
    result = prod((5, 10))
    print(result)
    
    • from math import prod
    • def multiply(a, b):
    • ints = (a, b)
    • return prod(ints)
    • result = multiply(5, 10)
    • result = prod((5, 10))
    • print(result)
Code
Diff
  • mod preloaded;
    use preloaded::Operation;
    
    fn calculator(op: Operation, x: i32, y: i32) -> Option<i32> {
        match op {
            Operation::Add => x.checked_add(y),
            Operation::Subtract => x.checked_sub(y),
            Operation::Multiply => x.checked_mul(y),
            Operation::Divide => x.checked_div(y),
            Operation::Modulo => x.checked_rem(y)
        }
    }
    • #include <iostream>
    • using namespace std;
    • mod preloaded;
    • use preloaded::Operation;
    • 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();
    • fn calculator(op: Operation, x: i32, y: i32) -> Option<i32> {
    • match op {
    • Operation::Add => x.checked_add(y),
    • Operation::Subtract => x.checked_sub(y),
    • Operation::Multiply => x.checked_mul(y),
    • Operation::Divide => x.checked_div(y),
    • Operation::Modulo => x.checked_rem(y)
    • }
    • }
Code
Diff
  • //Крюков Кирилл
    const cinema_auditorium = (spisok2D,ryad)=> {
      console.log(spisok2D[ryad].reduce((summa,chairs ) => summa + chairs, 0));
      var chairs = spisok2D[ryad].reduce((summa,chairs ) => summa + chairs, 0)
      return chairs;
    }
    • //Крюков Кирилл
    • const cinema_auditorium = (spisok2D,ryad)=> {
    • console.log(spisok2D,ryad)
    • return 3
    • console.log(spisok2D[ryad].reduce((summa,chairs ) => summa + chairs, 0));
    • var chairs = spisok2D[ryad].reduce((summa,chairs ) => summa + chairs, 0)
    • return chairs;
    • }
Code
Diff
  • //Недошивина
    function sumNechet(a, b) {
       let  sum = 0;
      for(let i = a; i <= b; i++){
        if(i % 2=== 1) 
          sum += i;
      }
      return  sum;
        }
    function нечетное(число) {
      
    }
    • //Недошивина
    • function sumNechet(a, b) {
    • }
    • let sum = 0;
    • for(let i = a; i <= b; i++){
    • if(i % 2=== 1)
    • sum += i;
    • }
    • return sum;
    • }
    • function нечетное(число) {
    • }
Code
Diff
  • function rps(p1, p2) {
        if (p1 === p2) return 'Draw!';
        const wins = { 'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock' };
        return wins[p1] === p2 ? 'Player 1 won!' : 'Player 2 won!';
    }
    
    • function rps(player1, player2) {
    • return player1 == player2 ? 'Draw!' :
    • player1 == 'rock' && player2 == 'scissors' ||
    • player1 == 'scissors' && player2 == 'paper' ||
    • player1 == 'paper' && player2 == 'rock' ? 'Player 1 won!' : 'Player 2 won!';
    • function rps(p1, p2) {
    • if (p1 === p2) return 'Draw!';
    • const wins = { 'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock' };
    • return wins[p1] === p2 ? 'Player 1 won!' : 'Player 2 won!';
    • }

SELECT *
FROM employees
WHERE salary > 5000000 AND months >= 12

Code
Diff
  • SELECT *
    FROM employees
    WHERE salary > 5000000 AND months >= 12 
    ORDER BY salary DESC
    • -- Code Here
    • SELECT *
    • FROM employees
    • WHERE salary > 5000000 AND months >= 12
    • ORDER BY salary DESC
Code
Diff
  • export default class BMI {
      private _height: number;
      private _weight: number;
      
      constructor(weight: number, height: number) {
        [this._height, this._weight] = [height, weight];
      }
      
      get bmi(): number {
        return Number((this._weight / Math.pow(this._height, 2)));
      }
      
      calculateBMI(): string {
        return `there is ${this.bmi < 25 ? 'no ' : ''}excess weight`;
      }
    }
    • export default class BMI {
    • private _height: number;
    • private _weight: number;
    • constructor(weight: number, height: number) {
    • this._height = height;
    • this._weight = weight;
    • }
    • set height(height: number) {
    • if (height <= 0) {
    • const invalidValueError = new Error('Invalid value');
    • console.error(invalidValueError);
    • }
    • this._height = height;
    • }
    • set width(weight: number) {
    • if (weight <= 0) {
    • const invalidValueError = new Error('Invalid value');
    • console.error(invalidValueError);
    • }
    • this._weight = weight;
    • [this._height, this._weight] = [height, weight];
    • }
    • get bmi(): number {
    • return Number((this._weight / Math.pow(this._height, 2)).toFixed(2));
    • return Number((this._weight / Math.pow(this._height, 2)));
    • }
    • calculateBMI(): string {
    • return `there is ${this.bmi < 25 ? 'no ' : ''}excess weight`;
    • }
    • }
Code
Diff
  • const numMinusSeven = function(num) {
      //let youGoodBro = [];
      let count = 0 ; 
      while (num > 0) {
        num -= 7;
        count ++;
       // youGoodBro.push(num);
      }
      return count;
    }
    • const numMinusSeven = function(num) {
    • let youGoodBro = [];
    • //let youGoodBro = [];
    • let count = 0 ;
    • while (num > 0) {
    • num -= 7;
    • youGoodBro.push(num);
    • count ++;
    • // youGoodBro.push(num);
    • }
    • return youGoodBro.length;
    • return count;
    • }

recursion

Code
Diff
  • def sum(arr):
        if not arr: return 0;
        return arr[0] + sum(arr[1:])
        
    • def sum(arr):
    • result = 0
    • for i in arr:
    • result += i
    • return result
    • if not arr: return 0;
    • return arr[0] + sum(arr[1:])