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
  • class CannabisHash:
        """Cannabis hash-id class"""
        
        def __init__(self, value):
            self.value = value
    
        def __hash__(self, ):
            return id(self.value) % 420
    
    
    if __name__ == '__main__':
        cannabis = "marijuana"
        cannabis_hash = CannabisHash(cannabis)
        print(f'The hash value of "marijuana" is: {hash(cannabis)}.')
        print(f'The cannabis-hash value of "marijuana" is: {hash(cannabis_hash)}.')
    • cannabis = "marijuana"
    • print(f"Hash value of marijuana is: {hash(cannabis)}")
    • # i am noob
    • # i barely understand python
    • class CannabisHash:
    • """Cannabis hash-id class"""
    • def __init__(self, value):
    • self.value = value
    • def __hash__(self, ):
    • return id(self.value) % 420
    • if __name__ == '__main__':
    • cannabis = "marijuana"
    • cannabis_hash = CannabisHash(cannabis)
    • print(f'The hash value of "marijuana" is: {hash(cannabis)}.')
    • print(f'The cannabis-hash value of "marijuana" is: {hash(cannabis_hash)}.')
Code
Diff
  • is_equal=lambda a,b:"yneos"[a!=b::2]
    • is_equal = lambda a, b: {0: 'no', 1: 'yes'}[a == b]
    • is_equal=lambda a,b:"yneos"[a!=b::2]
Fundamentals
Arrays
Strings
Code
Diff
  • def find_trex(lst):
        return 'Tyrannosaurus' in lst
    • public class findT_Rex {
    • public static boolean containsT_Rex(String[] things) {
    • //insert code!
    • return true;
    • }
    • }
    • def find_trex(lst):
    • return 'Tyrannosaurus' in lst
Fundamentals
Strings
Code
Diff
  • digest = lambda food: ''.join([f'{letter} ' for letter in food]).rstrip()
    • def digest(food):
    • return " ".join(food)
    • digest = lambda food: ''.join([f'{letter} ' for letter in food]).rstrip()
Code
Diff
  • def factorial(n):
        return 1 if n == 0 else eval('*'.join([str(i) for i in range(1, n+1)]))
    • factorial=n=>(x=1,[...{*[Symbol.iterator](){for(i=2;i<=n;i++)yield x*=i}}],x)
    • def factorial(n):
    • return 1 if n == 0 else eval('*'.join([str(i) for i in range(1, n+1)]))
Code
Diff
  • upper_case = lambda s: s.lower().swapcase()
    
    • pub fn make_uppercase(s: String) -> String {
    • s.to_uppercase()
    • }
    • upper_case = lambda s: s.lower().swapcase()
Code
Diff
  • is_divisible = lambda n, x, y: all([n % i == 0 for i in [x, y]])
    • is_divisible = lambda n, x, y: not n%x + n%y
    • is_divisible = lambda n, x, y: all([n % i == 0 for i in [x, y]])
Fundamentals
Code
Diff
  • def hello_message():
        msg = 'Hello World!'
        return msg
    
    
        
    • fun main() = print("Hi")
    • def hello_message():
    • msg = 'Hello World!'
    • return msg
Fundamentals
Code
Diff
  • def is_even(n):
        return n ^ 1 == n + 1
    • def is_even(n):
    • return n & 1 == 0
    • return n ^ 1 == n + 1