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

i just setted up a Alias for a native function that solves the problem

Code
Diff
  • // solved in tests
    • function caps($c) {return ucwords($c);}
    • // solved in tests

Refactored code to be more efficient. 🗿

Code
Diff
  • import statistics
    
    def est_height(gender, dad_height, mom_height):
        SPEEDOFLIGHT = 299792458
        MODIFIER = 0.5
        
        boy_height = statistics.mean([dad_height, mom_height]) + (SPEEDOFLIGHT * (MODIFIER / SPEEDOFLIGHT))
        girl_height = statistics.mean([dad_height, mom_height]) - (SPEEDOFLIGHT * (MODIFIER / SPEEDOFLIGHT))
        
        if gender is "boy": 
            return boy_height 
        elif gender is "girl":  
            return girl_height
    • import statistics
    • def est_height(gender, dad_height, mom_height):
    • if gender=="boy":
    • return ((dad_height + mom_height)/2)+0.5
    • else:
    • return ((dad_height + mom_height)/2)-0.5
    • SPEEDOFLIGHT = 299792458
    • MODIFIER = 0.5
    • boy_height = statistics.mean([dad_height, mom_height]) + (SPEEDOFLIGHT * (MODIFIER / SPEEDOFLIGHT))
    • girl_height = statistics.mean([dad_height, mom_height]) - (SPEEDOFLIGHT * (MODIFIER / SPEEDOFLIGHT))
    • if gender is "boy":
    • return boy_height
    • elif gender is "girl":
    • return girl_height

use const or let keyword before variable name;

Code
Diff
  • /*def hello_world(world):
        if world == True:
            return "Hello World baby"
        elif world == False:
            return "No World"*/
    
    // helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
    
    const helloWorld=(world)=>world==true?`Hello World baby`:`No World`;
    • /*def hello_world(world):
    • if world == True:
    • return "Hello World baby"
    • elif world == False:
    • return "No World"*/
    • // helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
    • helloWorld
    • =(_)=>
    • _?`Hello World baby`:`No World`
    • const helloWorld=(world)=>world==true?`Hello World baby`:`No World`;
Code
Diff
  • const cinema_auditorium = (spisok2D,ryad) => spisok2D[ryad].reduce((sum, el)=> sum+el);
    • const cinema_auditorium = (spisok2D,ryad)=> {
    • return spisok2D[ryad].reduce((sum, el)=> sum+el)
    • }
    • const cinema_auditorium = (spisok2D,ryad) => spisok2D[ryad].reduce((sum, el)=> sum+el);