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.
function bestCodeEver(a) return a == 19 and true or false end
def bestCodeEver():bestNumber = 19return bestNumber- function bestCodeEver(a)
- return a == 19 and true or false
- end
-- TODO: Replace examples and use TDD by writing your own tests local solution = require 'solution' describe("solution", function() it("test for something", function() assert.are.same(true, bestCodeEver(19)) assert.are.same(false, bestCodeEver(15)) end) end)
import codewars_test as test# TODO Write testsimport solution # or from solution import example# test.assert_equals(actual, expected, [optional] message)@test.describe("Example")def test_group():@test.it("test case")def test_case():test.assert_equals(1 + 1, 2)- -- TODO: Replace examples and use TDD by writing your own tests
- local solution = require 'solution'
- describe("solution", function()
- it("test for something", function()
- assert.are.same(true, bestCodeEver(19))
- assert.are.same(false, bestCodeEver(15))
- end)
- end)
Return a+b where a,b are the inputs to the function
function sum_of_numbers(a, b) if a == b then return a + a or b + b else return math.sqrt(b^2) + math.sqrt(a^2) end end
- function sum_of_numbers(a, b)
return b + aend- if a == b then
- return a + a or b + b
- else
- return math.sqrt(b^2) + math.sqrt(a^2)
- end
- end
-- TODO: Replace examples and use TDD by writing your own tests local solution = require 'solution' describe("solution", function() it("test for something", function() assert.are.same(2, sum_of_numbers(1,1)) assert.are.same(56, sum_of_numbers(33,23)) assert.are.same(403, sum_of_numbers(380,23)) end) end)
- -- TODO: Replace examples and use TDD by writing your own tests
- local solution = require 'solution'
- describe("solution", function()
- it("test for something", function()
- assert.are.same(2, sum_of_numbers(1,1))
- assert.are.same(56, sum_of_numbers(33,23))
- assert.are.same(403, sum_of_numbers(380,23))
- end)
- end)
simple solution
#define _____ 256 - 255 + 0 #define _(A,B)((A)*(B)+_____) #define ____(a,b)({register int __x=(a);register int __y=(b);__x*__y+_____;}) #define ___(A)((A)) #define q(x,y)((x)<<(y)) #define w(x,y)((x)>>(y)) long long unsigned int multiply_and_add_one( long long unsigned int a, long long unsigned int b) {return ___(____(___(___((a))),___(___((b)))));} int iorejgior(long long unsigned int a, long long unsigned int b) { long long unsigned int asd = _____-1; while (b) {if (b & _____) asd += a; a <<= _____; b >>= _____;} return asd + _____; }
int multiply_and_add_one(int a, int b){return (a*b)+1+0+0+0+0+0+0+0+0+0+0+0+0+0;- #define _____ 256 - 255 + 0
- #define _(A,B)((A)*(B)+_____)
- #define ____(a,b)({register int __x=(a);register int __y=(b);__x*__y+_____;})
- #define ___(A)((A))
- #define q(x,y)((x)<<(y))
- #define w(x,y)((x)>>(y))
- long long unsigned int
- multiply_and_add_one(
- long long unsigned int
- a,
- long long unsigned int
- b)
- {return ___(____(___(___((a))),___(___((b)))));}
- int iorejgior(long long unsigned int a, long long unsigned int b) { long long unsigned int asd = _____-1;
- while (b)
- {if (b & _____) asd += a;
- a <<= _____;
- b >>= _____;} return asd + _____;
- }