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 usefull for algorithmic tasks, where your code has to have certain complexity. It is not a save way of using In/out, so I woudln't reccomend using it somewhere else besides webpages like SPOJ etc. where programms read from standard input and write to standard output. It should compile with newest gcc and -std=c++11 flag.
Try to write your own functions for fixed point types and cstrings! =)

Bibliography:
http://www.algorytm.edu.pl/fast-i-o.html

#include <cstdio>

template <class type>
inline void getUI ( type* des ) // reads unsigned integer from input
{
  register char c = 0;
  while ( c <= ' ' ) c = getc_unlocked(stdin);
  (*des) = 0;
  while ( c > ' ' )
  {
    (*des) = (*des) * 10 + ( c - '0' );
    c = getc_unlocked(stdin);
  }
}
template <class type>
inline void putUI ( type src ) // writes unsigned integer to output
{
  if ( src == 0 )
  {
    putc_unlocked( '0', stdout );
    return;
  }
  register char c [21];
  register short k = 0;
  while ( src > 0 )
  {
    c[k ++] = src % 10 + '0';
    src /= 10;
  }
  -- k;
  while ( k >= 0 )
    putc_unlocked( c[k --], stdout );
}

int main ()
{
  putUI(2000);
}
hsamuelsonFailed Tests

R Tests

plot a quadradic from 0-10, with the equation x^2

print("Hellow")
#THis doesnt work becasue R is not supported yet

Given a list contains string, such as ['I','love','you'] .Then output 'I love you'.
A kumite try by beginer.
Note that the extra space should be added between strings , but not at the begining or the ending.

def get_list(may):
    out=''
    for i in may:
        out+=i+' '
    return out[:-1]
Ruby on Rails
Frameworks
rails
Ruby Gems
class SolutionController < ActionController::Base
  def show
    tag = Tag.create!(title: 'Test')
    render json: tag
  end
end

ActiveRecord::Schema.define do
    create_table :tags do |table|
      table.column :title, :string
    end
end

class Tag < ActiveRecord::Base
end
console.log('Hola mundo');
const html = '<iframe width=100% height=640 src="https://stemkoski.github.io/Three.js/Particle-Engine.html"></iframe>';
console.log(html);
Numbers
Data Types
Integers
Algorithms
Logic

Determine number of decimal digits in an unsiged 64bit integer.

fn digits(mut n: u64) -> usize {
    let mut l = 1;
    while n >= 10 {
        n /= 10;
        l += 1;
    }
    l
}
Algorithms
Logic
Mathematics
Numbers

Return the factorial of a given input number.

Note that the number must be equal or greater than 1.

i.e.:

factorial(6) = 720
factorial(5) = 120
def factorial(x):
    return 1 if x == 1 else x*factorial(x-1)
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char plaintext[100];
char ciphertext[100];
int length;
int key;
  cout<<"enter the plain message\n\n";
  cin.getline(plaintext,99,'\n');
cout<<"enter the key :";
cin>>key;
cout<<"----------\n";
cout<<"the cipher message\n\n";
length=strlen(plaintext);
int i = 0;
	 for(i=0;i<length;i++)
{
	if(plaintext[i]==' ')
{
  ciphertext[i]=' ';
  cout<<ciphertext[i];
  continue;
}
  int y=(int)plaintext[i];
  if (y>96)
{
  y=y-32;
  plaintext[i]=(char)y;
}
int x =((((int)plaintext[i]-65)+key)%26)+65;
ciphertext[i]=(char)x;
cout<<ciphertext[i];
}
cout<<"\n\n";
return(0);
}