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
  • # Something something code here
    Something = lambda something, code, here: ""
    # I forked the code
    I = lambda something, code, here: ""
    # Now it's a kata
    • # Something something code here
    • Something = lambda something, code, here: ""
    • # I forked the code
    • I = lambda something, code, here: ""
    • # Now it's a kata
Code
Diff
  • from time import time,sleep
    a=time()
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    sleep(1)
    return_10 = lambda: int(time()-a)
    • return_10 = lambda: ord("d") - ord("Z")
    • from time import time,sleep
    • a=time()
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • sleep(1)
    • return_10 = lambda: int(time()-a)

Return the nth digit of PI.

1 Million Digits of Pi have been included in the preloaded code. Use it to negotiate the task.

Note: The decimal is not included in the index.

Code
Diff
  • def happy_pi(n):
        digits_of_pi = {k: v for (k,v) in enumerate([i for i in PI if i.isdigit()])}
        return digits_of_pi[n]
    
    • import math
    • from decimal import Decimal as D
    • from decimal import getcontext
    • def pi(p=5):
    • getcontext().prec = p
    • pi = D(0)
    • r = 8
    • for k in range(10000):
    • pi += D(math.pow(r * 2, -k)) * (
    • D(r / 2 / (r * k + 1)) - D(2 / (r * k + 4)) - D(1 / (r * k + 5)) - D(1 / (r * k + 6)))
    • return str(pi)
    • def happy_pi(n):
    • digits_of_pi = {k: v for (k,v) in enumerate([i for i in PI if i.isdigit()])}
    • return digits_of_pi[n]
Code
Diff
  • def adeel_gradute(essay, tutor):
        return tutor.join(essay)
    • def adeel_gradute(s):
    • return " ".join(s)
    • def adeel_gradute(essay, tutor):
    • return tutor.join(essay)
Strings
Sets
Code
Diff
  • def cake_maker(cake_mix: str) -> str:
        ingredients = "cake"
        cake_mix = cake_mix.lower()
        bowl = set()    
        for ingredient in cake_mix:
            if ingredient in ingredients:
                cake_mix = ingredient
                bowl.add(cake_mix)
                ingredients = ingredients.replace(cake_mix, '')    
        cake_batter = True if ingredients == '' and len(bowl) == 4 else False
        def bake(cake):
            if cake:
                return "Cake"
            return "Not enough to make the cake!"    
        return bake(cake_batter)
    • def cake_maker(word: str) -> str:
    • ingredients = {"c","a","k","e"}
    • cake_mix = set(word.lower())
    • if cake_mix >= ingredients:
    • return 'Cake'
    • else:
    • return 'Not enough to make the cake!'
    • def cake_maker(cake_mix: str) -> str:
    • ingredients = "cake"
    • cake_mix = cake_mix.lower()
    • bowl = set()
    • for ingredient in cake_mix:
    • if ingredient in ingredients:
    • cake_mix = ingredient
    • bowl.add(cake_mix)
    • ingredients = ingredients.replace(cake_mix, '')
    • cake_batter = True if ingredients == '' and len(bowl) == 4 else False
    • def bake(cake):
    • if cake:
    • return "Cake"
    • return "Not enough to make the cake!"
    • return bake(cake_batter)
Code
Diff
  • exec(bytes('桴畯慳摮氽浡摢⁡㵮‸椺瑮戨湩渨嬩㨲⥝', 'u16')[2:])
    • def thousand(n=8):
    • return (n << n - 1) - n * 3
    • exec(bytes('桴畯慳摮氽浡摢⁡㵮‸椺瑮戨湩渨嬩㨲⥝', 'u16')[2:])