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.
shorten
import java.util.*; class Vehicle { int currentSpeed; Road currentRoad = new Road(60); public void setCurrentSpeed(int... accelerations) { currentSpeed = Arrays.stream(accelerations).sum(); } public int getCurrentSpeed() { return currentSpeed; } public boolean isWithinSpeedLimit() { return currentSpeed <= currentRoad.speedLimit; } } final class Road { int speedLimit; public Road(int speedLimit) { this.speedLimit = speedLimit; } }
- import java.util.*;
/**an object of class blahauthordate*/- class Vehicle {
/**I make up the class invariant, I describe speed limit*/final int SPEED_LIMIT = 60;/**I make up the class invariant, i describe current speed*/int currentSpeed;public void setCurrentSpeed(int[] accelerations) {currentSpeed = Arrays.stream(accelerations).sum();}/**i describe current speed*/public int getCurrentSpeed() {return currentSpeed;}/**i describe within speed limit*/public boolean isWithinSpeedLimit() {return getCurrentSpeed() <= SPEED_LIMIT;}- int currentSpeed;
- Road currentRoad = new Road(60);
- public void setCurrentSpeed(int... accelerations) {
- currentSpeed = Arrays.stream(accelerations).sum();
- }
- public int getCurrentSpeed() {
- return currentSpeed;
- }
- public boolean isWithinSpeedLimit() {
- return currentSpeed <= currentRoad.speedLimit;
- }
- }
- final class Road {
- int speedLimit;
- public Road(int speedLimit) {
- this.speedLimit = speedLimit;
- }
- }
aaaaaaaaaaaaaaaaaaaaaaaaa
I don't think mine is correct since the "golfed" part was the return type.
Readable
public static class Kata { public static int SameCase(char a, char b) { if (!char.IsLetter(a) || !char.IsLetter(b)) return -1; return char.IsUpper(a) == char.IsUpper(b) ? 1 : 0; } }
- public static class Kata
- {
public static int SameCase(char a, char b) =>(!char.IsLetter(a) || !char.IsLetter(b)) ? -1 :(char.IsLower(a) == char.IsLower(b)) ? 1 : 0;- public static int SameCase(char a, char b)
- {
- if (!char.IsLetter(a) || !char.IsLetter(b))
- return -1;
- return char.IsUpper(a) == char.IsUpper(b) ? 1 : 0;
- }
- }
import kotlin.test.Test import kotlin.test.assertEquals class ReturnIntTest { @Test fun return_int_test() { assertEquals(return_int(10), 10); } }
#[test]fn return_int_test() {assert_eq!(return_int(10), 10);- import kotlin.test.Test
- import kotlin.test.assertEquals
- class ReturnIntTest {
- @Test
- fun return_int_test() {
- assertEquals(return_int(10), 10);
- }
- }