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

more tests and more edge case testing lol

Code
Diff
  • def you_are_cool(n):
        if not isinstance(n, str):
            return "Wait, so your name ISN'T a string of text?! That's wild!"
        elif n.strip() == "":
            return "There is no name, so I'm not complimenting you. LOL"
        elif len(n.strip()) > 100:
            return "Man, you have an insanely long name! Do people call you by your full name or just a nickname?"
        elif n.strip().isdigit():
            return "Are you sure? That looks like a number. Unless you're secretly a robot with a numerical name!"
        else:
            return "Hello " + n.strip() + ", you are very cool!"
        
    # edge case go BRRR
    • def your_name(n="Taki"):
    • return f"Hello {n}, you are very kool!"
    • def you_are_cool(n):
    • if not isinstance(n, str):
    • return "Wait, so your name ISN'T a string of text?! That's wild!"
    • elif n.strip() == "":
    • return "There is no name, so I'm not complimenting you. LOL"
    • elif len(n.strip()) > 100:
    • return "Man, you have an insanely long name! Do people call you by your full name or just a nickname?"
    • elif n.strip().isdigit():
    • return "Are you sure? That looks like a number. Unless you're secretly a robot with a numerical name!"
    • else:
    • return "Hello " + n.strip() + ", you are very cool!"
    • # edge case go BRRR
Code
Diff
  • helloWorld
    
        =_=>
    
            _?`Hello World baby`:`No World`
    • /*def hello_world(world):
    • if world == True:
    • return "Hello World baby"
    • elif world == False:
    • return "No World"*/
    • helloWorld
    • // helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
    • =_=>
    • const helloWorld=(world)=>world==true?`Hello World baby`:`No World`;
    • _?`Hello World baby`:`No World`
Fundamentals
Strings
Code
Diff
  • reverse_string = lambda string: "".join(reversed(string))
    • reverse_string = lambda string: string[::-1]
    • reverse_string = lambda string: "".join(reversed(string))
Code
Diff
  • prod = __import__('math').prod
    • from math import prod as p
    • prod = lambda a: p(a)
    • prod = __import__('math').prod
Code
Diff
  • object FindMultiples:
      def findMultiples: Int => Int = n =>
        (0 until n by 2).filter(i => (i%4)*(i%6) == 0).sum
    
    • object FindMultiples:
    • def findMultiples(n: Int): Int =
    • Seq.range(0, n).filter(i => i % 4 == 0 || i % 6 == 0).sum
    • def findMultiples: Int => Int = n =>
    • (0 until n by 2).filter(i => (i%4)*(i%6) == 0).sum