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

def multiply(a,b):
result = a*b
return result
res = multiply (5,10)
print(res)

Code
Diff
  • def multiply(a,b):
        result = a*b
        return result
    res = multiply (5,10)
    print(res)
    
    • def multiply(a,b):
    • result = a*b
    • return result
    • multiply (5,10)
    • print(multiply(5,10))
    • res = multiply (5,10)
    • print(res)
Code
Diff
  • func gradeCalc(_ score: Int) -> String {
        (score < 0 || score > 100) ? "Not a grade" : String(Array("FFFFFFDCBAA")[score / 10]);
    }
    • func gradeCalc(_ score: Int) -> String {
    • (score < 0 || score > 100) ? "Not a grade" : ["F","F","F","F","F","F","D","C","B","A","A"][score / 10];
    • (score < 0 || score > 100) ? "Not a grade" : String(Array("FFFFFFDCBAA")[score / 10]);
    • }
Code
Diff
  • //Крюков Кирилл
    const tab = (f, a, b, h) => {
      let summa = 0;
      for (var x = a; x <= b; x = x + h){
        summa = summa + f(x);
      }
     return summa;
    }
    • //Крюков Кирилл
    • const tab = (f, a, b, h) => {
    • let summa = 0;
    • for (var x = a; x <= b; x = x + h){
    • summa = summa + f(x);
    • }
    • return summa;
    • }
Code
Diff
  • const cinema_auditorium = (spisok2D,ryad)=> {
      var soldTickets = 0;
      for (var i = 0; i < spisok2D[ryad].length; i++){
        if (spisok2D[ryad][i] !== 0){
          soldTickets++
        }
      }
      return soldTickets;
    }
    • const cinema_auditorium = (spisok2D,ryad)=> {
    • console.log(spisok2D,ryad)
    • return 3
    • var soldTickets = 0;
    • for (var i = 0; i < spisok2D[ryad].length; i++){
    • if (spisok2D[ryad][i] !== 0){
    • soldTickets++
    • }
    • }
    • return soldTickets;
    • }
Code
Diff
  • function sumNechet(a, b) {
      let sum = 0;
      
      function нечетное(x){
        return x % 2 !== 0;
      }
      for (let i = a; i <= b; i++){
        if(нечетное(i)){
          sum += i;
        }
      }
      return sum
                
    }
    
    • function sumNechet(a, b) {
    • let sum = 0;
    • function нечетное(x){
    • return x % 2 !== 0;
    • }
    • for (let i = a; i <= b; i++){
    • if(нечетное(i)){
    • sum += i;
    • }
    • }
    • return sum
    • }
    • function нечетное(число) {
    • }
Code
Diff
  • fn longest_string(strings: &str) -> &str {
        strings
            .split(',')
            .map(|s| s.trim())
            .filter(|s| s.chars().all(|c| c.is_ascii_alphanumeric()))
            .max_by_key(|s| s.len())
            .unwrap_or("")
    }
    • def lenght_line(line='marry, ksnfgjji233jc, harry!@#'):
    • return 'ksnfgjji233jc,'
    • fn longest_string(strings: &str) -> &str {
    • strings
    • .split(',')
    • .map(|s| s.trim())
    • .filter(|s| s.chars().all(|c| c.is_ascii_alphanumeric()))
    • .max_by_key(|s| s.len())
    • .unwrap_or("")
    • }
Code
Diff
  • fn converter(n: u8) -> &'static str {
        match n {
            0 => "zero",
            1 => "one",
            2 => "two",
            3 => "three",
            4 => "four",
            5 => "five",
            6 => "six",
            7 => "seven",
            8 => "eight",
            9 => "nine",
            _ => panic!()
        }
    }
    • def converter(number):
    • if number == 0:
    • return "zero"
    • elif number == 5:
    • return "five"
    • return number
    • fn converter(n: u8) -> &'static str {
    • match n {
    • 0 => "zero",
    • 1 => "one",
    • 2 => "two",
    • 3 => "three",
    • 4 => "four",
    • 5 => "five",
    • 6 => "six",
    • 7 => "seven",
    • 8 => "eight",
    • 9 => "nine",
    • _ => panic!()
    • }
    • }
Code
Diff
  • fn nand(a: bool, b: bool) -> bool {
        !(a && b)
    }
    
    fn not(a: bool) -> bool {
        nand(a, a)
    }
    
    fn and(a: bool, b: bool) -> bool {
        not(nand(a, b))
    }
    
    fn or(a: bool, b: bool) -> bool {
        nand(not(a), not(b))
    }
    
    fn xor(a: bool, b: bool) -> bool {
        and(nand(a, b), or(a, b))
    }
    
    fn nor(a: bool, b: bool) -> bool {
        and(not(a), not(b))
    }
    
    • bool Or(bool a, bool b){
    • if(!a){
    • if(!b){
    • return false;
    • }
    • }
    • return true;
    • fn nand(a: bool, b: bool) -> bool {
    • !(a && b)
    • }
    • bool Xor(bool a, bool b){
    • return a != b;
    • fn not(a: bool) -> bool {
    • nand(a, a)
    • }
    • bool And(bool a, bool b){
    • if(a){
    • if(b){
    • return true;
    • }
    • }
    • return false;
    • fn and(a: bool, b: bool) -> bool {
    • not(nand(a, b))
    • }
    • fn or(a: bool, b: bool) -> bool {
    • nand(not(a), not(b))
    • }
    • fn xor(a: bool, b: bool) -> bool {
    • and(nand(a, b), or(a, b))
    • }
    • fn nor(a: bool, b: bool) -> bool {
    • and(not(a), not(b))
    • }
Code
Diff
  • fn fizzbuzzy(n: u32) -> u32 {
        n/3 + n/5 + 2
    }
    • function fizzbuzzy(n) {
    • //insert code here
    • fn fizzbuzzy(n: u32) -> u32 {
    • n/3 + n/5 + 2
    • }
Arrays
Code
Diff
  • fn remove<T>(mut arr: Vec<T>, n: usize) -> Vec<T> {
        if n < arr.len() {
            arr.remove(n);
        }
        arr
    }
    • function remove (arr, n) {
    • if (n < 0 || n >= arr.length) return arr;
    • arr.splice(n, 1);
    • return arr;
    • fn remove<T>(mut arr: Vec<T>, n: usize) -> Vec<T> {
    • if n < arr.len() {
    • arr.remove(n);
    • }
    • arr
    • }