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 print_statements():
    
        # Printing lines of code:
        print("Hello Mark!","This is my first python script.","Python will be fun to learn!","I am not at COGS","I am at home in my jammies.")
    • def print_statements():
    • # Printing lines of code:
    • print(*("Hello Mark!","This is my first python script.","Python will be fun to learn!","I am not at COGS","I am at home in my jammies."))
    • print("Hello Mark!","This is my first python script.","Python will be fun to learn!","I am not at COGS","I am at home in my jammies.")
Fundamentals
Strings
Data Types
Algorithms
Logic
Code
Diff
  • palindrome = lambda word:word[::-1] == word
    
    • def palindrome(word):
    • return word[::-1] == word
    • palindrome = lambda word:word[::-1] == word
Code
Diff
  • #some code
    • multiply = lambda a,b: a*b
    • #some code
Code
Diff
  • exec(bytes('敭獳条㵥慬扭慤✺效汬潷汲Ⅴ℡‧','u16')[2:])
    • message = lambda: ''.join([chr(i) for i in [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]])
    • exec(bytes('敭獳条㵥慬扭慤✺效汬潷汲Ⅴ℡‧','u16')[2:])
Arithmetic
Mathematics
Algorithms
Logic
Numbers
Code
Diff
  • sum_last_two_items = lambda x: sum(x[-2:])
    • def sum_last_two_items(ls):
    • return sum(ls[-2:])
    • sum_last_two_items = lambda x: sum(x[-2:])
Code
Diff
  • def convert_decimalBinary(number: int) -> int:
        """Convert number into binary without using bin()"""
        powers = [pow(2, i) for i in range(12)][::-1]
        binary = ['0' for i in range(len(powers))]
    
        for i, num in enumerate(powers):
            if num <= number:
                number = number - num
                binary[i] = '1'
    
        return int(''.join(binary))
    
    • convert_decimalBinary=lambda i:int(bin(i)[2:])
    • def convert_decimalBinary(number: int) -> int:
    • """Convert number into binary without using bin()"""
    • powers = [pow(2, i) for i in range(12)][::-1]
    • binary = ['0' for i in range(len(powers))]
    • for i, num in enumerate(powers):
    • if num <= number:
    • number = number - num
    • binary[i] = '1'
    • return int(''.join(binary))

Another variant using IntStream. Probably much slower than using a for-loop.

Code
Diff
  • import java.util.stream.IntStream;
    
    public class Kata {
        public static int findIndex(int[] array, int target) {
            return IntStream.range(0, array.length).filter(i -> array[i] == target).findFirst().orElse(-1);
        }
    }
    • import java.util.Arrays;
    • import java.util.List;
    • import java.util.stream.Collectors;
    • import java.util.stream.IntStream;
    • public class Kata {
    • public static int findIndex (int[] array, int target) {
    • return Arrays.stream(array).boxed().collect(Collectors.toList()).indexOf(target);
    • public static int findIndex(int[] array, int target) {
    • return IntStream.range(0, array.length).filter(i -> array[i] == target).findFirst().orElse(-1);
    • }
    • }