Begin a new Kumite
Search
About
  • Filter by Language:
  • 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.

even(N) :- 0 is mod(N, 2).
Code
Diff
  • func abbrevName(_ name: String) -> String {
      let components = name.components(separatedBy: " ")
      let left: String = String(components[0].first!)
      return left + "." + components[1].first!.uppercased()
    }
  • 1-public class AbbreviateTwoWords {
    2-
    3- public static String abbrevName(String name) {
    4- String[] names = name.split(" ");
    5- return (names[0].charAt(0) + "." + names[1].charAt(0)).toUpperCase();
    6- }
    1+func abbrevName(_ name: String) -> String {
    2+ let components = name.components(separatedBy: " ")
    3+ let left: String = String(components[0].first!)
    4+ return left + "." + components[1].first!.uppercased()
    77 }
Code
Diff
  • def areMetaStrings(str1, str2):
        return sorted(str1.lower()) == sorted(str2.lower())
  • 1-func areMetaStrings(_ str1: String, _ str2: String) -> Bool {
    2- return str1.lowercased().sorted() == str2.lowercased().sorted()
    3-}
    1+def areMetaStrings(str1, str2):
    2+ return sorted(str1.lower()) == sorted(str2.lower())
Code
Diff
  • package solution
    
    object LambdaKotlin {
        @JvmStatic
        fun main(args: Array<String>) = listOf("hola","mundo","cruel").forEach(::println)
    }
  • 1-/**
    2- * Created by Javatlacati on 26/10/2016.
    3- */
    1+package solution
    2+
    44 object LambdaKotlin {
    55 @JvmStatic
    6- fun main(args: Array<String>) {
    7- val arr=arrayOf("hola","mundo","cruel")
    8- arr.forEach {
    9- println(it)
    10- }
    11- }
    5+ fun main(args: Array<String>) = listOf("hola","mundo","cruel").forEach(::println)
    1212 }

Error displaying in prolog.

Code
Diff
  • add(A, B, R) :- 
        number(A)
        , number(B)
        , R is A + B 
        +2 %wrong part to show formatting tricks
        .
  • 1-add(A, B, R) :- R is A + B.
    1+add(A, B, R) :-
    2+ number(A)
    3+ , number(B)
    4+ , R is A + B
    5+ +2 %wrong part to show formatting tricks
    6+ .