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.
fn flip_the_number(x: &u64) -> u64 { let reversed_str: String = x.to_string().chars().rev().collect(); let reversed_u64: u64 = reversed_str.parse().unwrap(); reversed_u64 }
- fn flip_the_number(x: &u64) -> u64 {
let mut x = *x;let mut y = 0;while x != 0 {y = y * 10 + x % 10;x /= 10;}y- let reversed_str: String = x.to_string().chars().rev().collect();
- let reversed_u64: u64 = reversed_str.parse().unwrap();
- reversed_u64
- }
Refactor the previous function body to one line.
function isEven(num) { return num % 2 === 0 ? true : num % 1 === 0 ? false : undefined; } // isEven(2); // Previous iteration // isEven = number => number %2 === 0 ? // true: number %1 === 0 ? // false : undefined;
isEven = number => number %2 === 0 ?true: number %1 === 0 ?false : undefined;- function isEven(num) {
- return num % 2 === 0 ? true : num % 1 === 0 ? false : undefined;
- }
- // isEven(2);
- // Previous iteration
- // isEven = number => number %2 === 0 ?
- // true: number %1 === 0 ?
- // false : undefined;