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.
public class FizzBuzz { public string GetOutput(int number) => number % 3 == 0 && number % 5 == 0 ? "FizzBuzz" : number % 3 == 0 ? "Fizz" : number % 5 == 0 ? "Buzz" : number.ToString(); }
- public class FizzBuzz
- {
public string GetOutput(int number){if (number % 3 == 0 && number % 5 == 0){return "FizzBuzz";}if (number % 3 == 0){return "Fizz";}if (number % 5 == 0){return "Buzz";}return number.ToString();}- public string GetOutput(int number) =>
- number % 3 == 0 && number % 5 == 0 ? "FizzBuzz" : number % 3 == 0 ? "Fizz" : number % 5 == 0 ? "Buzz" : number.ToString();
- }
def remove(lst, excluded): excluded = frozenset(excluded) return list(filter(lambda x: x not in excluded, lst))
def remove(integers, values):return list(filter(lambda x: x not in values,integers))- def remove(lst, excluded):
- excluded = frozenset(excluded)
- return list(filter(lambda x: x not in excluded, lst))
@test.describe("Basic Test Cases") def basic_test_cases(): test.assert_equals(remove([], []), []) test.assert_equals(remove([1, 1, 3, 5, 7, 7, 7, 9, 10, 10], [1, 7, 9]), [3, 5, 10, 10]) test.assert_equals(remove([1, 2, 3, 4, 5], [2, 4]), [1, 3, 5]) test.assert_equals(remove([1, 2, 3, 4, 5], [2, 4, 2, 4, 4]), [1, 3, 5]) test.assert_equals(remove(["a", "b", "c", "d", "e"], ["d", "n", "a"]), ["b", "c", "e"])
- @test.describe("Basic Test Cases")
- def basic_test_cases():
- test.assert_equals(remove([], []), [])
- test.assert_equals(remove([1, 1, 3, 5, 7, 7, 7, 9, 10, 10], [1, 7, 9]), [3, 5, 10, 10])
- test.assert_equals(remove([1, 2, 3, 4, 5], [2, 4]), [1, 3, 5])
- test.assert_equals(remove([1, 2, 3, 4, 5], [2, 4, 2, 4, 4]), [1, 3, 5])
- test.assert_equals(remove(["a", "b", "c", "d", "e"], ["d", "n", "a"]), ["b", "c", "e"])
package kumite import "time" func CheckWorkHours(dateTime time.Time) bool { const ( monday, friday = 1, 5 morning, evening = 8, 18 ) day, hour := dateTime.Weekday(), dateTime.Hour() return monday <= day && day <= friday && morning <= hour && hour < evening }
- package kumite
- import "time"
- func CheckWorkHours(dateTime time.Time) bool {
// It's better to have constants for work interval- const (
WK_HOUR_BEGIN = 8WK_HOUR_END = 18WK_DAY_BEGIN = 1WK_DAY_END = 6- monday, friday = 1, 5
- morning, evening = 8, 18
- )
hour := dateTime.Hour()day := dateTime.Weekday()- day, hour := dateTime.Weekday(), dateTime.Hour()
return WK_DAY_BEGIN <= day && day < WK_DAY_END && WK_HOUR_BEGIN <= hour && hour < WK_HOUR_END- return monday <= day && day <= friday && morning <= hour && hour < evening
- }