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
  • def where_were_you_when_codewars_died(activity='codewarz', location='127.0.0.1', food_source='coffee'):
        db = Connection()
        record = f"I was at {location} consuming {food_source} when {activity} died."
        return db.add_record(record)
        
    
    • where = lambda thing="codewar",home="home",food="dorito",phone="phone" : f"where were u wen {thing} die?\ni was at {home} eatin {food} wen {phone} ring\n\"{thing} is kil\"\n\"no\""
    • def where_were_you_when_codewars_died(activity='codewarz', location='127.0.0.1', food_source='coffee'):
    • db = Connection()
    • record = f"I was at {location} consuming {food_source} when {activity} died."
    • return db.add_record(record)
Fundamentals
Arrays
Code
Diff
  • def flatten_list(lst):
        def flatten(l):
            for i in l:
                if isinstance(i, (list, tuple)):
                    for j in flatten_list(i):
                        yield j
                else:
                    yield i
        return list(flatten(lst))
    • def flatten_list(lst):
    • pass
    • def flatten(l):
    • for i in l:
    • if isinstance(i, (list, tuple)):
    • for j in flatten_list(i):
    • yield j
    • else:
    • yield i
    • return list(flatten(lst))
Code
Diff
  • binary = lambda n: bin(n).replace('0b','')
    • def binary(n):
    • output = ''
    • while n:
    • if n%2:
    • output += '1'
    • else:
    • output += '0'
    • n=n//2
    • return output[::-1]
    • binary = lambda n: bin(n).replace('0b','')
Code
Diff
  • binary_to_integer = lambda b: int(b, 2)
    • def binary_to_integer(b):
    • return sum([x[0] for x in list(zip([pow(2,i) for i in range(len(b))], reversed(b))) if x[1] == '1'])
    • binary_to_integer = lambda b: int(b, 2)