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
def sum_sub(num1, opp, num2):
    if opp == '+':
        return num1 + num2

creating code that finds out the volume of the cube from the data (x,y,z)

def kube(x, y, z):
    #your code here
    return 0

print "hello there"

def hello_there():
    return "hello there"

Poor elm is lonley, it dosn't haven't have any kumite :C

Today, I fix that :D

module HelloWorld exposing (hello)

hello : String
hello = "Hello, Elm!"

Oh no, it's been 900 days (from May 15, 2020 - Nov 1, 2022), and yet no kumites for haxe :C

well now there is :D

class FirstKumite{
  public static function helloHaxe() {return "Hello, World!";}
}
// Tests are written using https://github.com/haxe-utest/utest
import utest.Assert;
import Solution;

class SolutionTest extends utest.Test {
  function testExample() {
    //it is so infuriating to see the "Expected" on the  left...
    Assert.equals("Hello, World!", FirstKumite.helloHaxe());
  }
}

Goal:
Create a program the generates the digits of Pi based on a requested digit (in base 10).

I.E.:
1 --> 3
2 --> 1
3 --> 4

If you want to use Math.PI and take the easy way out, go ahead. Just know that C# runs out of floating point precesion eventualy, so you can't just use Math.PI as you wont always get all the digits you nead. Instead, you can compute the digits yourself using an infinite series:

Pi = 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 +...

using System;

public class PiDigits
{
  public static int GetDigit(int digit)
  {
    
    return (int)(Math.Floor(Math.PI*Math.Pow(10.0,(double)digit-1))-Math.Floor(Math.PI*Math.Pow(10.0,(double)digit-2))*10);
      
  }
}
const A = 6;
const B = 8;

let person = {

}
person.A = A;
person.B = B
console.log(person)

for (; person.A <= person.B; person.A++) {
	console.log(person.A ** 3)
}
for (let i = 2; i <= 9; i++){
  if (i){
      console.log(`Дальше на ${i}:`)
    }
  for (let j = 1; j <= 10; j++){
    console.log(i * j)
  }
}
// В этом примере в промежутке от A до B 3 числа: 6, 7, 8. 
// Для 6 делители: 2, 3. Для 7 их нет. Для 8: 2, 4. 
// Т.е. нужно вывести последовательность из чисел 2, 3, 2, 4
const A = 6;
const B = 8;
// далее код
let num = {
}
num.A = A;
num.B = B;

 for (; num.A <= num.B; num.A++){
  ed: for (let j = 2; j < num.A; j++){
    if (num.A % j == 0){
      console.log(num.A / (num.A / j))
    } else {
      continue ed
    }
    
  } 
}

Intro
Jason is an integer k. It generates a special sequence A, and for each Ai in A there is: Ai = i & k.
He needs to find the sum of the frist k elements of the sequence.
Jason thinks it's really an easy task, so he throws it to you.

Input
line 1: three integers k

Output
line 1: the answer

Constraints
1<=k<=1e5

int kth(int k){
  //printf("%d\n",k);
  int ans=0;
  for(int i=0;i<k;++i) ans+=i&k;
  //printf("%d\n",ans);
  return ans;
}