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
Fundamentals
Logic

The Goose is an experienced motorcyclist and pursuit officer of the MFP. When he is present (i.e. True), The Interceptors speed increases by 20%.

Code
Diff
  • import datetime
    
    def fury_road(interceptor, night_rider, motorcycle_gang, the_goose):
        def calc_time(d, s):
            time = d / s
            hours = int(time)
            minutes = int((time * 60) % 60)
            seconds = int((time * 3600) % 60)
            return datetime.time(hours, minutes, seconds)
    
        night_rider_time = calc_time(night_rider.distance, night_rider.speed)
        if motorcycle_gang:
            interceptor.speed -= (.20 * interceptor.speed)
        if the_goose:
            interceptor.speed += (.20 * interceptor.speed)
            interceptor_time = calc_time(interceptor.distance, interceptor.distance)
        else:
            interceptor_time = calc_time(interceptor.distance, interceptor.speed)
    
        if interceptor_time <= night_rider_time:
            return 'The Nightrider, remember his name when you look into the night sky...'
        else:
            return "I am the Nightrider, I'm a rocker, I'm a roller, and I ain't never coming back!"
    • import datetime
    • def fury_road(interceptor, night_rider, motorcycle_gang):
    • def fury_road(interceptor, night_rider, motorcycle_gang, the_goose):
    • def calc_time(d, s):
    • time = d / s
    • hours = int(time)
    • minutes = int((time * 60) % 60)
    • seconds = int((time * 3600) % 60)
    • return datetime.time(hours, minutes, seconds)
    • night_rider_time = calc_time(night_rider.distance, night_rider.speed)
    • if motorcycle_gang:
    • interceptor.speed -= (.20 * interceptor.speed)
    • if the_goose:
    • interceptor.speed += (.20 * interceptor.speed)
    • interceptor_time = calc_time(interceptor.distance, interceptor.distance)
    • else:
    • interceptor_time = calc_time(interceptor.distance, interceptor.speed)
    • if interceptor_time <= night_rider_time:
    • return 'The Nightrider, remember his name when you look into the night sky...'
    • else:
    • return "I am the Nightrider, I'm a rocker, I'm a roller, and I ain't never coming back!"
Code
Diff
  • def or16(a, b):
        out = ['0'] * 16
        for i in range(16):
            out[i] = max(a[i] , b[i])
        return ''.join(out)
    
    • def or16(a, b):
    • out = ['0'] * 16
    • for i in range(16):
    • out[i] = a[i] or b[i]
    • out[i] = max(a[i] , b[i])
    • return ''.join(out)
Code
Diff
  • def greatest(lst):
        return int(''.join(sorted([str(n) for n in lst], reverse=True))) 
    • from collections import Counter
    • def greatest(lst):
    • c=Counter(lst)
    • acc=[]
    • for n in (9,8,7,6,5,4,3,2,1,0):
    • if n in c:
    • acc.append(str(n)*c[n])
    • acc="".join(acc)
    • return int(acc) if acc else 0
    • return int(''.join(sorted([str(n) for n in lst], reverse=True)))
Code
Diff
  • #include <iostream>
    using namespace std;
    int mai()
    {
        int x = 1;
        int u = 0, g = 0, c = 0;
        cout << "quanti anni ha l'uomo? (alla donna non si chiede)" << endl;
        cin >> u;
        while (x <= u)
        {
            if (x == 1)
            {
                g = 15;
                c = 15;
            }
            if (x == 2) {
                g += 9;
                c += 9;
            }
            if (x >= 3) {
                g += 4;
                c += 5;
            }
            x++;
        }
        cout << "cane " << c << endl;
        cout << "gatto " << g;
        return 0;
    }
    • #include <iostream>
    • using namespace std;
    • int main()
    • int mai()
    • {
    • int x = 1;
    • int u = 0, g = 0, c = 0;
    • cout << "quanti anni ha l'uomo? (alla donna non si chiede)" << endl;
    • cin >> u;
    • while (x <= u)
    • {
    • if (x == 1)
    • {
    • g = 15;
    • c = 15;
    • }
    • if (x == 2) {
    • g += 9;
    • c += 9;
    • }
    • if (x >= 3) {
    • g += 4;
    • c += 5;
    • }
    • x++;
    • }
    • cout << "cane " << c << endl;
    • cout << "gatto " << g;
    • return 0;
    • }
Code
Diff
  • function numMinusSeven(num) {
      return Math.ceil(num/7);
    }
    • function numMinusSeven(num) {
    • return (num-(num%7))/7+1
    • return Math.ceil(num/7);
    • }
Code
Diff
  • remainder = lambda x, y: x % y if x and y else -1
    
    • remainder = lambda x,y: x % y if x and y else -1
    • remainder = lambda x, y: x % y if x and y else -1
Code
Diff
  • fun Int.returnInt() = this
    • fun returnInt(i: Int) = i
    • fun Int.returnInt() = this
Fundamentals
Code
Diff
  • replace_key = lambda d, k1, k2: {k2: d.pop(k1), **d}
    • def replace_key(d, k1, k2):d[k2]=d.pop(k1);return d
    • replace_key = lambda d, k1, k2: {k2: d.pop(k1), **d}