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
  • const reverseWords = s => s.split(' ').reverse().join(' ');
    • reverseWords=s=>s.split(' ').reverse().join(' ');
    • const reverseWords = s => s.split(' ').reverse().join(' ');
Code
Diff
  • public func holabro(){
      a=3
      return ""
    }

Description

Create a function that accepts a string s and returns the sum of the ASCII values of each character in the given string.

Code
Diff
  • using System;
    using System.Linq;
    
    namespace Solution
    {
        public static class ToAscii
        {
            public static int GetAsciiSum(string s) => s.Select(character => (int)character).Sum();
        }
    }
    • using System;
    • namespace Solution{
    • public class ToAsci
    • {
    • public static int getAsciSum(string s)
    • {
    • int returner = 0;
    • foreach (var el in s)
    • returner += (int)el;
    • return returner;
    • }
    • }
    • using System.Linq;
    • namespace Solution
    • {
    • public static class ToAscii
    • {
    • public static int GetAsciiSum(string s) => s.Select(character => (int)character).Sum();
    • }
    • }
Code
Diff
  • from math import sqrt
    
    def primemaker(x):
        primes = []
        if x < 2:
            return []
        else:  
            primes.append(2)
            for possible_prime in range(3,(x+1), 2): # only odd numbers
                limit = sqrt(possible_prime)
                for prime in primes:
                    if prime > limit:
                        primes.append(possible_prime)
                        break
                    if 0 == possible_prime % prime:
                        break
        return primes
    
    
    • from math import sqrt
    • def primemaker(x):
    • primes = []
    • if x < 2:
    • return []
    • else:
    • primes.append(2)
    • for possible_prime in range(3,(x+1), 2): # only odd numbers
    • limit = sqrt(possible_prime)
    • is_prime = True
    • for prime in primes:
    • if prime > limit:
    • primes.append(possible_prime)
    • break
    • if 0 == possible_prime % prime:
    • is_prime = False
    • break
    • if is_prime:
    • primes.append(possible_prime)
    • return primes
Code
Diff
  • from collections import Counter
    
    def FindOnly(values):
        items = Counter(values)
        for item in items:
            if items[item] == 1:
                return item
    • from collections import Counter
    • def FindOnly(values):
    • for value in set(values):
    • if 1 == values.count(value): # check value is unique
    • return value
    • items = Counter(values)
    • for item in items:
    • if items[item] == 1:
    • return item
Code
Diff
  • function returnhundred() {
      return 'd'.charCodeAt();
    }
    • function returnhundred() {
    • return require('crypto').createHash('sha').update('Robson').digest()[0]
    • return 'd'.charCodeAt();
    • }
Code
Diff
  • function fizzBuzz(num) {
        for (let i=1;i <= num; i++) {
            if (i%3===0) {console.log("fizz");};
            if (i%5===0) {console.log("buzz");}
            if (i%15===0) {console.log("fizzbuzz");}
        }
    };
    
    fizzBuzz(15); // 
    • function fizzBuzz(num) {
    • for (let i=1;i <= (num); i++) {
    • let fb = '';
    • if (i%3===0) {fb = fb + 'fizz'};
    • if (i%5===0) {fb = fb + 'buzz'};
    • if (fb==='') { console.log(i); } else { console.log(fb); };
    • for (let i=1;i <= num; i++) {
    • if (i%3===0) {console.log("fizz");};
    • if (i%5===0) {console.log("buzz");}
    • if (i%15===0) {console.log("fizzbuzz");}
    • }
    • };
    • fizzBuzz(15); //