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
  • import re
    
    
    def amongus(sus):
        return [list(re.search(re.compile('sus'), sus).span())[0]]
    • amongus = lambda sus: [i for i in range(len(sus) - 2) if sus[i:i + 3].lower() == 'sus']
    • import re
    • def amongus(sus):
    • return [list(re.search(re.compile('sus'), sus).span())[0]]
Code
Diff
  • english = "From my heart’s grief I wrote a letter to my beloved. For an age, from your absence, I have witnessed the resurrection. I have a hundred signs of separation in my eye"
    sufi = "از خون دل نوشتم نزدیک دوست نامه; انی رایت دهرا من هجرک القیامه; دارم من از فراقش در دیده صد علامت"
    reduce_to_ord = lambda txt: sum(ord(c) for c in txt)
    
    def return_hundred():
        return reduce_to_ord(english) + reduce_to_ord(sufi) - 144235
    
    • english = "From my heart’s grief I wrote a letter to my beloved. For an age, from your absence, I have witnessed the resurrection. I have a hundred signs of separation in my eye"
    • sufi = "از خون دل نوشتم نزدیک دوست نامه; انی رایت دهرا من هجرک القیامه; دارم من از فراقش در دیده صد علامت"
    • reduce_to_ord = lambda txt: sum(ord(c) for c in txt)
    • def return_hundred():
    • kk = 100
    • return kk * 100000000000000000000000000000000000000 // 100000000000000000000000000000000000000
    • return reduce_to_ord(english) + reduce_to_ord(sufi) - 144235
Code
Diff
  • from sys import getsizeof
    def should_return_1():
        return (getsizeof([])//getsizeof(True))//(getsizeof([])//getsizeof(True))
    • from sys import getsizeof
    • def should_return_1():
    • return 1 * 1 * 1 * 1 * 1 * 1 * 1
    • return (getsizeof([])//getsizeof(True))//(getsizeof([])//getsizeof(True))
Code
Diff
  • Something = lambda something, code, here: code + something + here
    I = lambda code, here: code + here
    Want = lambda to, code, here: to + code + here
    
    print(I('C', 'o') + Want('d', 'e', 'w') + Something('r', 'a', 's'))
    • # Something something code here
    • Something = lambda something, code, here: ""
    • # I forked the code
    • I = lambda something, code, here: ""
    • # Now it's a kata
    • Something = lambda something, code, here: code + something + here
    • I = lambda code, here: code + here
    • Want = lambda to, code, here: to + code + here
    • print(I('C', 'o') + Want('d', 'e', 'w') + Something('r', 'a', 's'))
Code
Diff
  • def return_10():
        return int(ord("ᕟ")^ord("ᕕ"))
        
        
        
    • def r():
    • def t():
    • return int("10",2)
    • def e():
    • return int("1000",2)
    • return t() ^ e()
    • return_10 = r
    • def return_10():
    • return int(ord("ᕟ")^ord("ᕕ"))
Code
Diff
  • import java.util.*;
    
    class Vehicle {
    
        int currentSpeed;
        Road currentRoad = new Road(60);
    
        public void setCurrentSpeed(int... accelerations) {
            currentSpeed = Arrays.stream(accelerations).sum();
        }
        
        public int getCurrentSpeed() {
            return currentSpeed;
        }
    
        public boolean isWithinSpeedLimit() {
            return currentSpeed <= currentRoad.speedLimit();
        }
      
        public int getTicketCost() {
          if (currentSpeed >= currentRoad.speedLimit() + 30) {
            return 500;
          }
          
          if (currentSpeed >= currentRoad.speedLimit() + 20) {
            return 250;
          }
          
          if (currentSpeed >= currentRoad.speedLimit() + 10) {
            return 100;
          }
          
          return 0;
        }
    }
    
    record Road(int speedLimit) { }
    
    • import java.util.*;
    • class Vehicle {
    • int currentSpeed;
    • Road currentRoad = new Road(60);
    • public void setCurrentSpeed(int... accelerations) {
    • currentSpeed = Arrays.stream(accelerations).sum();
    • }
    • public int getCurrentSpeed() {
    • return currentSpeed;
    • }
    • public boolean isWithinSpeedLimit() {
    • return currentSpeed <= currentRoad.speedLimit;
    • return currentSpeed <= currentRoad.speedLimit();
    • }
    • public int getTicketCost() {
    • if (currentSpeed>=currentRoad.speedLimit+10&&currentSpeed<currentRoad.speedLimit+19) {
    • return 100;
    • } else if (currentSpeed>=currentRoad.speedLimit+20&&currentSpeed<currentRoad.speedLimit+29) {
    • return 250;
    • } else if (currentSpeed>=currentRoad.speedLimit+30) {
    • return 500;
    • }
    • return 0;
    • if (currentSpeed >= currentRoad.speedLimit() + 30) {
    • return 500;
    • }
    • if (currentSpeed >= currentRoad.speedLimit() + 20) {
    • return 250;
    • }
    • if (currentSpeed >= currentRoad.speedLimit() + 10) {
    • return 100;
    • }
    • return 0;
    • }
    • }
    • final class Road {
    • int speedLimit;
    • public Road(int speedLimit) {
    • this.speedLimit = speedLimit;
    • }
    • }
    • record Road(int speedLimit) { }
Code
Diff
  • def addition(a, b):
        return len(range(a + b))
    • def addition(a, b):
    • return len([1 for i in range(a+b)])
    • return len(range(a + b))
Code
Diff
  • def thousand(n=8):
        return sum(n * x for x in range(15, 40, 5))
    • def thousand(n=8):
    • return [i + (n * 1 + 2) ** 3 for i in range((n * 1 + 2)+5)][0]
    • return sum(n * x for x in range(15, 40, 5))