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.

Original seems to do unnecessary computation before ultimately returning True

Code
Diff
  • def above_two(_):
        return True
    • #If it is not true currently, I shall make it true
    • def above_two(arg):
    • return abs(arg)+3>2
    • def above_two(_):
    • return True
Code
Diff
  • public class DrivingTestEvaluator{
      public static boolean evaluate(String road, String exam){
        //your code here
    //test
        return true;
        }
    }
    • public class DrivingTestEvaluator{
    • public static boolean evaluate(String road, String exam){
    • //your code here
    • //test
    • return true;
    • }
    • }
Code
Diff
  • is_perfect_square:=>@^.5%1==0
    • is_perfect_square: => @ ^ 0.5 % 1 == 0
    • is_perfect_square:=>@^.5%1==0
Code
Diff
  • extern malloc
    global reverse_string
    reverse_string:
      mov rcx, -1
    rs_continue:
      inc rcx
      cmp byte [rdi+rcx], 0
      jnz rs_continue
      
      push rcx
      push rdi
      call malloc
      pop rdi
      pop rbx
      mov rcx, 0
    
    
    rs_copy:
      dec rbx
      
      mov dl, [rdi+rbx]
      mov [rax+rcx], dl
      inc rcx
      cmp rbx, 0
      jnz rs_copy
      
      mov byte [rax+rcx], 0
      ret
    
    • #include <stdlib.h>
    • #include <string.h>
    • char* reverse_string(const char* word) {
    • if (!word) {
    • return NULL;
    • }
    • extern malloc
    • global reverse_string
    • reverse_string:
    • mov rcx, -1
    • rs_continue:
    • inc rcx
    • cmp byte [rdi+rcx], 0
    • jnz rs_continue
    • push rcx
    • push rdi
    • call malloc
    • pop rdi
    • pop rbx
    • mov rcx, 0
    • size_t len = strlen(word);
    • char* res = (char*)malloc(len + 1);
    • if (!res) {
    • return NULL;
    • }
    • for (size_t i = 0; i < len; ++i) {
    • res[i] = word[len - 1 - i];
    • }
    • res[len] = '\0';
    • return res;
    • }
    • rs_copy:
    • dec rbx
    • mov dl, [rdi+rbx]
    • mov [rax+rcx], dl
    • inc rcx
    • cmp rbx, 0
    • jnz rs_copy
    • mov byte [rax+rcx], 0
    • ret