Start a new Kumite
AllAgda (Beta)BF (Beta)CCFML (Beta)ClojureCOBOL (Beta)CoffeeScriptCommonLisp (Beta)CoqC++CrystalC#D (Beta)DartElixirElm (Beta)Erlang (Beta)Factor (Beta)Forth (Beta)Fortran (Beta)F#GoGroovyHaskellHaxe (Beta)Idris (Beta)JavaJavaScriptJulia (Beta)Kotlinλ Calculus (Beta)LeanLuaNASMNim (Beta)Objective-C (Beta)OCaml (Beta)Pascal (Beta)Perl (Beta)PHPPowerShell (Beta)Prolog (Beta)PureScript (Beta)PythonR (Beta)RacketRaku (Beta)Reason (Beta)RISC-V (Beta)RubyRustScalaShellSolidity (Beta)SQLSwiftTypeScriptVB (Beta)
Show only mine

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.

Ad
Ad

It is easy, for example: you have to change "Hello World" to "HeLlOwOrLd".

public class HeLlOwOrLddddd {
  public static String convert(String input) {
      String salida = "";
      boolean mayus = true;
      for (int i=0;i<input.length();i++){
        if (Character.isLetter(input.charAt(i))){
            if (mayus){
                salida+=Character.toUpperCase(input.charAt(i));
                mayus=false;
            }else{
                salida+=Character.toLowerCase(input.charAt(i));
                mayus=true;
            }
        }        
    }
      return salida;

  }
}

Extremely bad distribution with rndSelect', needs fixing.
About the warning: https://github.com/idris-lang/Idris-dev/blob/master/docs/reference/erasure.rst
Also: https://github.com/idris-lang/Idris-dev/issues/4193

The effects library has been deprecated in favor of Control.ST, that is on contrib.

module Identity

%access export
%default total

idString : String -> String
idString = id

Given 2 lists, find if one is the scramble of the other. If it is, return True, else return False

module Scramble where 

scramble :: String -> String -> Bool
scramble a b = "Scarmble this up"
Functions
Control Flow
Basic Language Features
Fundamentals

Write the definition of a function max that has three int parameters and returns the largest.

def largest(num1,num2,num3):
	max(num1,num2,num3)
console.log("Amirshoh's Kumite #2") ;
module Foo

export
foo : Int -> Int
foo 0 = 0
module Main

foo : Int -> Int
foo 0 = 0

bar : List Int -> Int
bar [] = 0

main : IO ()
main = do
  putStrLn "==="
  printLn (foo 1)
  putStrLn "==="
  printLn (bar [1])
  putStrLn "==="

Find all the possible combinations for an arbitrary number of arrays.

Example:

const result = createCombinations([
  ['red', 'blue'],
  ['small', 'large']
]);

// Result:
[
  ['red', 'small'],
  ['red', 'large'],
  ['blue', 'small'],
  ['blue', 'large']
]
function createCombinations(input) {

}
module IndexOf

import Data.List

%access export

total
elemIndex' : (x : Int) -> (ys : List Int) -> {auto ok : Elem x ys} -> Nat
elemIndex' x (z :: zs) {ok} with (decEq x z)
                               | Yes _ = 0
                               | No _ with (ok)
                                         | Here impossible
                                         | There _ = S (elemIndex' x zs)

-- partial
-- elemIndex' : (x : Int) -> (ys : List Int) -> Nat
-- elemIndex' x ys =
--   case elemIndex x ys of
--     Just n => n

Write a function caesar() that will return the input message with each character shifted to the right n times in the alphabet. Make sure the encoded message is in all caps since the Romans didn't use lowercase letters. Only punks use lowercase letters.

Example : 'James is the greatest at kumite!' => 'MDPHV LV WKH JUHDWHVW DW NXPLWH!'

Make sure to preserve the spaces and punctuation of the original message, you know, for clarity's sake.

// Description:
// Write a function caesar() that will return the input message with each character 
// shifted to the right n times in the alphabet. Make sure the encoded message is in 
// all caps since the Romans didn't use lowercase letters. Only punks use lowercase letters.

// Example : 'James is the greatest at kumite!' => 'MDPHV LV WKH JUHDWHVW DW NXPLWH!'

// Make sure to preserve the spaces and punctuation of the original message, you know, for clarity's sake.

const caesar = (shift, msg) => {

};