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.
reverseWords=s=>s.split(' ').reverse().join(' ');
function reverseWords(str) {return str.split(" ").reverse().join(" ")}- reverseWords=s=>s.split(' ').reverse().join(' ');
// TODO: Add your tests here // Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework. // [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework) // are still available for now. // // For new tests, using [Chai](https://chaijs.com/) is recommended. // You can use it by requiring: // const assert = require("chai").assert; // If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted. describe("Solution", function() { it("should test for something", function() { Test.assertEquals(reverseWords("are you that wise"), "wise that you are"); }); });
- // TODO: Add your tests here
- // Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.
- // [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)
- // are still available for now.
- //
- // For new tests, using [Chai](https://chaijs.com/) is recommended.
- // You can use it by requiring:
- // const assert = require("chai").assert;
- // If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.
- describe("Solution", function() {
- it("should test for something", function() {
// Test.assertEquals(1 + 1, 2);// assert.strictEqual(1 + 1, 2);- Test.assertEquals(reverseWords("are you that wise"), "wise that you are");
- });
- });
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
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 uniquereturn value- items = Counter(values)
- for item in items:
- if items[item] == 1:
- return item
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); //
Trimmed the lambda
function getGemsOfColor(color, gems) { return gems.filter(gem => gem.colors.includes(color)).map(it => it.name).sort(); }
- function getGemsOfColor(color, gems) {
return gems.filter(gem => gem.colors.includes(color)).map(it => {return it.name}).sort();- return gems.filter(gem => gem.colors.includes(color)).map(it => it.name).sort();
- }