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
Code
Diff
  • int returnhundred()
    {
      return 100;
    }
    • int returnhundred()
    • {
    • return 'h' ^ 'u' ^ 'n' ^ 'd' ^ 'r' ^ 'e' ^ 'd';
    • return 100;
    • }
Code
Diff
  • bool isLeap(int year) {
      if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))
        return true;
      return false;
    }
    • bool isLeap(int year) {
    • return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
    • if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))
    • return true;
    • return false;
    • }
Code
Diff
  • int nbDaysInMonth(int n, bool m) {
      switch(n) {
          case 2:
            if (m == true)
              return 29;
            else
              return 28;
            case 4:case 6:case 9: case 11:
              return 30;
            default:
              return 31;
      }
    }
    • int nbDaysInMonth(int n, bool m) {
    • return n == 2 ? 28 + m : 30 + (n + (n > 7) & 1);
    • switch(n) {
    • case 2:
    • if (m == true)
    • return 29;
    • else
    • return 28;
    • case 4:case 6:case 9: case 11:
    • return 30;
    • default:
    • return 31;
    • }
    • }
Code
Diff
  • namespace Problem{
      using System;
      public class ProblemCanvas{
        public static void Main(){
          int b = 16; //re used variable for max amount of repeats
          int a = 6;
          for(int x = a; x < b; x++) //switched it to a for loop for simplicity in reading
            Console.WriteLine("Matthew is gay");
        }
        
        
      }
    }
    
    
    
    
    • var b = 5;
    • var a = 6;
    • namespace Problem{
    • using System;
    • public class ProblemCanvas{
    • public static void Main(){
    • int b = 16; //re used variable for max amount of repeats
    • int a = 6;
    • for(int x = a; x < b; x++) //switched it to a for loop for simplicity in reading
    • Console.WriteLine("Matthew is gay");
    • }
    • }
    • }
    • do {
    • console.log("Matthew is gay");
    • a++;
    • } while(a<16);
Code
Diff
  • import sys
    from pathlib import Path
    
    # looks like the original tries to print the contents of 
    # all files in the top 3 levels of the virtual environment
    # but has a problem where it's iterating over a string instead
    # of a recursive directory listing
    # namely it's like
    # >> os.listdir('.venv')
    # ['.bar', 'baz', '.foo']
    # then iterating over each one as if it's a dirname
    # so it tries opening .venv/., then .venv/b, then .venv/a then .venv/r
    # it's also printing a listdir of the nested directories instead of saving
    # the listdir, which might make it work if subsequently iterated
    # I'd imagine it's trying to print all text files in the virtual environment
    # this would do what the original looks like it's trying to do,
    # with a bonus of actually working if the venv isn't in ${pwd}/.venv
    # and if you're in a venv
    def walk_dont_run():
        if sys.prefix != sys.base_prefix:
            start = Path(sys.prefix)
            if start:
                for path in start.glob('**/*'):
                    try:
                        print(path.read_text())
                    except: pass
    
    • import os
    • import subprocess
    • print((ve := os.listdir(".venv")))
    • for x in ve:
    • try:
    • print(x, os.listdir(f".venv/{x}"))
    • for y in x:
    • try:
    • print(y, os.listdir(f".venv/{x}/{y}"))
    • for z in y:
    • try:
    • with open(f".venv/{x}/{y}/{z}","r") as file: print(file.open())
    • except:
    • print("...goes on...")
    • except:
    • import sys
    • from pathlib import Path
    • # looks like the original tries to print the contents of
    • # all files in the top 3 levels of the virtual environment
    • # but has a problem where it's iterating over a string instead
    • # of a recursive directory listing
    • # namely it's like
    • # >> os.listdir('.venv')
    • # ['.bar', 'baz', '.foo']
    • # then iterating over each one as if it's a dirname
    • # so it tries opening .venv/., then .venv/b, then .venv/a then .venv/r
    • # it's also printing a listdir of the nested directories instead of saving
    • # the listdir, which might make it work if subsequently iterated
    • # I'd imagine it's trying to print all text files in the virtual environment
    • # this would do what the original looks like it's trying to do,
    • # with a bonus of actually working if the venv isn't in ${pwd}/.venv
    • # and if you're in a venv
    • def walk_dont_run():
    • if sys.prefix != sys.base_prefix:
    • start = Path(sys.prefix)
    • if start:
    • for path in start.glob('**/*'):
    • try:
    • with open(rf".venv/{x}") as f:
    • print(f.read())
    • except:
    • print()
    • except:
    • with open(rf".venv/{x}") as f:
    • print(f.read())
    • print(path.read_text())
    • except: pass
Code
Diff
  • from random import choice
    class Random_Bool:
        @staticmethod
        def r():
            return choice((True, False))
    
    • from random import getrandbits
    • class Random_Bool(object):
    • def __repr__(self):
    • return repr(self.r())
    • def __init__(self):
    • self.r = lambda: bool(getrandbits(1))
    • random_boolean = Random_Bool()
    • from random import choice
    • class Random_Bool:
    • @staticmethod
    • def r():
    • return choice((True, False))
Code
Diff
  • module ToUpperFirst where
    
    import Data.Char (toUpper)
        
    mapcap :: String -> String
    mapcap = unwords . map (\(l:ls) -> toUpper l:ls) . words
    
    • module ToUpperFirst where
    • import Data.Char
    • import Data.List
    • import Data.Char (toUpper)
    • mapcap :: String -> String
    • mapcap = concat . intersperse " " . fmap (\(l:ls) -> (toUpper l):ls) . words
    • mapcap = unwords . map (\(l:ls) -> toUpper l:ls) . words
Code
Diff
  • import __hello__
    • print ("Hello word") #print Halwe ke halwe fix the cde dumbfuck
    • import __hello__
Code
Diff
  • sleep 1d
    • t(){for(;;);}
    • sleep 1d