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
Fundamentals
Strings
Code
Diff
  • def reverse_string(n):
        #return n[::-1]
        return ''.join(reversed(n))
        
    • def reverse_string(n):
    • return n[::-1]
    • #return n[::-1]
    • return ''.join(reversed(n))
Code
Diff
  • cat = """                                                                           ........                                      ...........                                                            
                                                                                       ...*@@@%.....                                .....#@**@#....                                                          .
                                                                                      ..-@+--==@%....                              ....+@*-===+@# ...                                                     ....
                                                                                   ....%@-------*@+....                            ...@@-=------*@=...                                                    ....
                                                                                   .. @@----------@@....                         ...-@#--------=--@%...                                                   ....
                                                                                 ....@%------------%@:.....                     ...#@=-------------@%...                                                  ....
                                                                                ....@%-------------=+@+.....                   ...@@----------------%@.  .                                              ......
                                                                               ....@#-----------------@#....                  ...@%----------------=-@%...  .                                           ......
                                                                              ....@%-----------------=-@@....                ...@#--------------------@@... .                                           ......
                                                     ....                     ...@@---------------------*@....................:@+=---------------------@#.....                          ....            ....  
                                                   .....................     ...*@----------------------==@*:::=*#%@@@@@@@@@@@@-------------------------@#....                 ..........:..            ....  
                                                   .........::=*#@@@#-.........-@=--------------------------===%@----@%----=@%--------------------------=@+.....           ......-#%#-......                  
                                                             .........=%@%-....@*-----------------------------=+@#=--#@-----%@----------------------------@=....        ....-%@*:......                       
                                                                    ......-@@+%@------------------------------=-@@---=@==--=*@----------------------------+@-....  .....:%@%:.........                        
                                                                         ....=@@+-=-----------------------------=#----%+----------------------------------=+@........-%@*......                               
                                                                          ...@#-*@+-------------------------------------------------------------------------+@:...-@@#....   .                                
                                                                          ..+@-=--+@=-----------------------------------------------------------------------=+@:%@*.......                                    
                                                                          ..@+=-----==-----------------------------------------------------------------------#@@:.....                                        
                                                                         ..#%------------------------------------------------------------------------------@@+-+@.....                                        
                                                   ............. .........:@=---------------------------------------------------------------------------=@@=---=*@....                                        
                                                .......:-====--::.........%*-------------------------------------------------------------=-=##=--------%@-=------*@...                                        
                                               ...*#=:.  .  ..:--+*%@@@@@#@---------------------==@@@@#------------------*=--------------=@@@@@@-----=#*---------=#%..      .. ....  .......                  
                                               .... .....................@**@@@*-=--------------=@@@@@@%----------------*+=--------------%@@@@@@#-----=------------@*......... ....:..... .....               
                                               ...  .                 ..=@--==-+@@=------------=*@@@@@@@--------------=+@%=--------------*@@@@@@+=----------------=-@=-+%@@@@%##*+====---:.....               
                                                                     ...##--------%+-------------%@@@@@=---------===-=@#==-#@#===---------*@@@@+----------------*@@@@@=............                           
                                                                     ...@+-----------------------=-+*=-----------%@@@+=======*+----------------------------=%@@#=---=+@.. ........                            
                                                                     ..#@-------------------------------------------@========+*=-------------------------------------=*@....                                  
                                                                     .:@*-------------------------------------------+%-======%=----------------------------------------%#...                                  
                                                                    ..%@--------------------------------------------=+@=---+@*=-----------------------------------------@-..                                  
                                                                  ...-@*---------------------------------------------=--===--=------------------------------------------=@...                                 
                                                                  ...@@-------------------------------------------------------------------------------------------------=#%...                                
                                                                  ..+@+---------------------------------------------------------------------------------------------------@=..                                
                                                                 ...@%----------------------------------------------------------------------------------------------------=@...                               
                                           .........             ..+@=-----------------------------------------------------------------------------------------------------#%...                              
                                           .........             ..@#-=-----------------------------------------------------------------------------------------------------@-..                              
    ........                               .........            ..*@--------------------------------------------------------------------------------------------------------=@..                              
    ........                               .........           ..:@*--------------------------------------------------------------------------------------------------------=%*...                            
    .....                             ..............          ...%@----------------------------------------------------------------------------------------------------------=@...                            
    .....                           ..............           ...-@=-----------------------------------------------------------------------------------------------------------#%....                          
    ........                        ..............           ...@%-----------------------------------------------------------------------------------------------------------==@-...                          
    ...........                     ............             ..-@--------------------------------------------------------------------------------------------------------------#@..                           
    ...........                     ............             ..%@@%-=-----------------------------------------------------------------------------------------------------------@-...                         
    ...........                                             ..=@***#@+=-------------------------------------------------------------------------------------=++++=-------------=#@...                         
    ...........                                            ...@%*****@*=------------------------=--=+*###*=---------------------------------------------#@@@%****%@@%-----------=@-..                         
                                                           ..*@*******@------------------------@@@%#*++++*%@@@+----------------------------------------#=--------==-%@-----------#@...                        
                                                           ..@#*******@+-------------------------------------+@@---------------------------------------------------=+@=---------=-@:...                       
                                                          ..#@*******#@--------------------------------------==@+--------------------------------------------------%@#------------##...                       
                                                         ..:@#***##%@%-=------------------------------------=%@%----------------------------------------+++*#%@@@@@+---------------@...                       
                                                         ..*%=+**+=--=--------------------------------+*%@@@@*---------------------------------------------------------------------%+..                       
                                                         ..@-=----------------------------------+%%%@%%#+=--==---------------------------------------------------------------------+@...                      
    ......................      ......                  ..*%------------------------------------------------------------------------------------------------------------------------@:...                     
    ....................................                ..@=------------------------------------------------------------------------------------------------------------------------#*...                     
    ....................................               ..=@-------------------------------------------------------------------------------------------------------------------------=@ ..                     
    ....................................               . %+--------------------------------------------------------------------------------------------------------------------------@:...                    
    ....................    ..........                ..:@---------------------------------------------------------------------------------------------------------------------------##...                    
    ...................    ...........               ...##---------------------------------------------------------------------------------------------------------------------------=@...                    
    ..................     ...........               ...@=----------------------------------------------------------------------------------------------------------------------------@:..                    
                            ......                    .-@-----------------------------------------------------------------------------------------------------------------------------%+.                     
                          ........                   ..*@##%@%-----------------------------------------------------------------------------------------------------------------------=+%....                  
                          .....                      . @#****#@*-----------------------------------------------------------------------------------------------------------------------@....                  
                          ........                   ..@*******@*----------------------------------------------------------------------------------------------------------------------@:...                  
                          .........                  .=@*******#@+---------------------------------------------------------------------------------------------------------------------%+. .                  
                          .........                 ..%%********@#---------------------------------------------------------------------------------------------------------------------*%. .                  
                          .........                 ..@#*******@@----------------------------------------------------------------------------------------------------------------------+@...                  
                          .........                 ..@%##%%@@@*-=---------------------------------------------------------------------------------------------------------------------=@...                  
                          .........                ..:@-===-----------------------------------------------------------------------------------------------------------------------------@:..                  
                            ......                 ..=@---------------------------------------------------------------------------------------------------------------------------------@-..                  
                                                   ..+%---------------------------------------------------------------------------------------------------------------------------------@- .                  
                                                  ...*#---------------------------------------------------------------------------------------------------------------------------------@=...                 
                    ........                      ...##---------------------------------------------------------------------------------------------------------------------------------@+..                  
                  ....:........                   ...#*---------------------------------------------------------------------------------------------------------------------------------@+..                  
                  ..@*--*@%.. ..                  ...#*---------------------------------------------------------------------------------------------------------------------------------@= .                  
                  .=%----=-#@.....                ...##---------------------------------------------------------------------------------------------------------------------------------@-..                  
                  .*%=-==%@@@@%......             ...+%---------------------------------------------------------------------------------------------------------------------------------@-..                  
                  .=@--%@*****#@+.. .             ...=@---------------------------------------------------------------------------------------------------------------------------------@...                  
                  ..@*#%*******#@@-...            ...:@--------------------------------------------------------------------------------------------------------------------------------=@...                  
                  ..=@@*****#@#---*@+......        ...@=------------------------------------------------------------------------------------------------------------------------------=*@...                  
                  ...*@****%%------+%@@-....        ..%*=------------------------------------------------------------------------------------------------------------------------------%=...                  
                   ...+@###@-=---%@#***#@@*.......  ..-@-----------------------------------------------------------------------------------------------------------------------------=-@....                  
                     ...@@%*--=-@%*****#@#=*@@#-.......@=-----------------------------------------------------------------------------------------------------------------------------*%...                   
                      ...*@%---*@*****#@-=---@**#@@@@@@@@-----------------------------------------------------------------------------------------------------------------------------@-...                   
                      .....#@#-#%*****@==---@#*****@+==-@+=--------------------------------------------------------------------------------------------------------------------------*@...                    
                         ....+@@@****#@----*@******@----+@---------------------------------------------------------------------------------------------------------------------------@....                    
                           ....:%@@#*#@=---%%******@+----#@-------------------------------------------------------------------------------------------------------------------------@+....                    
                            ......:%@@@@*--+@******%@==---%%-----------------------------------------------------------------------------------------------------------------------%%.....                    
                                .......=#@@@@@%%##**#@@%**=%@-=-------------------------------------------------------------------------------------------------------------------%#......                    
                                   ............:-=+*#****=:.=@==-----------------------------------------------------------------------------------------------------------------%#. ...                      
                                                  ............@@-=------------------------------------------------------------------------------------------------------------==@=....                        
                                                             ..:@%------------------------------------------------------------------------------------------------------------@%....                          
                                                             .....@@=-------------------------------------------------------------------------------------------------------@@......                          
                                                               .....+@%=-=----------------------------------------------------------------------------------------------=#@*........                          
                                                                  .. ..=@@*-----------------------------------------------------------------------------------------=#@@*...........                          
                                                                    . ....:#@@*=-=--------------------------------------------------------------------------=--=*@@%=.........                                
                                                                     ..........+@@@#=--=-----------------------------------------------------------------=#@@@%- .....                                        
                                                                             .....@-+#@@@%#+=---------------------------------------------------=+*%@@@@#+=---@.......                                        
                                                                               ...@-=------=@#%@@@@@%*+==--------------------------==+*#%@@@@@%*=:..@---------%-...                                           
                                                                               ..:@---------@:........::-=+*##%%@@@@@@@@@@@@%%##*+=-::..............@---------#-. .                                           
                                                                               ...@-=-------@..    ..........  ..  ..........  ....  ...    .   ....#*--------@....                                           
                                                                               ...#%-------*@........      .    .  .. .     .    .    .     .   .....@+=-----%*....                                           
                                                                                ...@%-----+@:...                                                  ....*@#+=+@=.....                                           
                                                                                ....-@%#%@@...                                                     .......:.....                                              
                                                                                 .............                                                           ... ...  """                                            
                                                                                                                                                                                          
        #meow! ^_^
                                                                                                                                                                                                              
                                                                                                                                                                                                              
                                                                                                                                                                                                              
                                                                                                                                                                                                              
                                                                                                                                                                                                              
                                                                                                                                                                                                              
                                                                                                                                                                                                              
    
    
    
    
    • None
    • cat = """ ........ ...........
    • ...*@@@%..... .....#@**@#.... .
    • ..-@+--==@%.... ....+@*-===+@# ... ....
    • ....%@-------*@+.... ...@@-=------*@=... ....
    • .. @@----------@@.... ...-@#--------=--@%... ....
    • ....@%------------%@:..... ...#@=-------------@%... ....
    • ....@%-------------=+@+..... ...@@----------------%@. . ......
    • ....@#-----------------@#.... ...@%----------------=-@%... . ......
    • ....@%-----------------=-@@.... ...@#--------------------@@... . ......
    • .... ...@@---------------------*@....................:@+=---------------------@#..... .... ....
    • ..................... ...*@----------------------==@*:::=*#%@@@@@@@@@@@@-------------------------@#.... ..........:.. ....
    • .........::=*#@@@#-.........-@=--------------------------===%@----@%----=@%--------------------------=@+..... ......-#%#-......
    • .........=%@%-....@*-----------------------------=+@#=--#@-----%@----------------------------@=.... ....-%@*:......
    • ......-@@+%@------------------------------=-@@---=@==--=*@----------------------------+@-.... .....:%@%:.........
    • ....=@@+-=-----------------------------=#----%+----------------------------------=+@........-%@*......
    • ...@#-*@+-------------------------------------------------------------------------+@:...-@@#.... .
    • ..+@-=--+@=-----------------------------------------------------------------------=+@:%@*.......
    • ..@+=-----==-----------------------------------------------------------------------#@@:.....
    • ..#%------------------------------------------------------------------------------@@+-+@.....
    • ............. .........:@=---------------------------------------------------------------------------=@@=---=*@....
    • .......:-====--::.........%*-------------------------------------------------------------=-=##=--------%@-=------*@...
    • ...*#=:. . ..:--+*%@@@@@#@---------------------==@@@@#------------------*=--------------=@@@@@@-----=#*---------=#%.. .. .... .......
    • .... .....................@**@@@*-=--------------=@@@@@@%----------------*+=--------------%@@@@@@#-----=------------@*......... ....:..... .....
    • ... . ..=@--==-+@@=------------=*@@@@@@@--------------=+@%=--------------*@@@@@@+=----------------=-@=-+%@@@@%##*+====---:.....
    • ...##--------%+-------------%@@@@@=---------===-=@#==-#@#===---------*@@@@+----------------*@@@@@=............
    • ...@+-----------------------=-+*=-----------%@@@+=======*+----------------------------=%@@#=---=+@.. ........
    • ..#@-------------------------------------------@========+*=-------------------------------------=*@....
    • .:@*-------------------------------------------+%-======%=----------------------------------------%#...
    • ..%@--------------------------------------------=+@=---+@*=-----------------------------------------@-..
    • ...-@*---------------------------------------------=--===--=------------------------------------------=@...
    • ...@@-------------------------------------------------------------------------------------------------=#%...
    • ..+@+---------------------------------------------------------------------------------------------------@=..
    • ...@%----------------------------------------------------------------------------------------------------=@...
    • ......... ..+@=-----------------------------------------------------------------------------------------------------#%...
    • ......... ..@#-=-----------------------------------------------------------------------------------------------------@-..
    • ........ ......... ..*@--------------------------------------------------------------------------------------------------------=@..
    • ........ ......... ..:@*--------------------------------------------------------------------------------------------------------=%*...
    • ..... .............. ...%@----------------------------------------------------------------------------------------------------------=@...
    • ..... .............. ...-@=-----------------------------------------------------------------------------------------------------------#%....
    • ........ .............. ...@%-----------------------------------------------------------------------------------------------------------==@-...
    • ........... ............ ..-@--------------------------------------------------------------------------------------------------------------#@..
    • ........... ............ ..%@@%-=-----------------------------------------------------------------------------------------------------------@-...
    • ........... ..=@***#@+=-------------------------------------------------------------------------------------=++++=-------------=#@...
    • ........... ...@%*****@*=------------------------=--=+*###*=---------------------------------------------#@@@%****%@@%-----------=@-..
    • ..*@*******@------------------------@@@%#*++++*%@@@+----------------------------------------#=--------==-%@-----------#@...
    • ..@#*******@+-------------------------------------+@@---------------------------------------------------=+@=---------=-@:...
    • ..#@*******#@--------------------------------------==@+--------------------------------------------------%@#------------##...
    • ..:@#***##%@%-=------------------------------------=%@%----------------------------------------+++*#%@@@@@+---------------@...
    • ..*%=+**+=--=--------------------------------+*%@@@@*---------------------------------------------------------------------%+..
    • ..@-=----------------------------------+%%%@%%#+=--==---------------------------------------------------------------------+@...
    • ...................... ...... ..*%------------------------------------------------------------------------------------------------------------------------@:...
    • .................................... ..@=------------------------------------------------------------------------------------------------------------------------#*...
    • .................................... ..=@-------------------------------------------------------------------------------------------------------------------------=@ ..
    • .................................... . %+--------------------------------------------------------------------------------------------------------------------------@:...
    • .................... .......... ..:@---------------------------------------------------------------------------------------------------------------------------##...
    • ................... ........... ...##---------------------------------------------------------------------------------------------------------------------------=@...
    • .................. ........... ...@=----------------------------------------------------------------------------------------------------------------------------@:..
    • ...... .-@-----------------------------------------------------------------------------------------------------------------------------%+.
    • ........ ..*@##%@%-----------------------------------------------------------------------------------------------------------------------=+%....
    • ..... . @#****#@*-----------------------------------------------------------------------------------------------------------------------@....
    • ........ ..@*******@*----------------------------------------------------------------------------------------------------------------------@:...
    • ......... .=@*******#@+---------------------------------------------------------------------------------------------------------------------%+. .
    • ......... ..%%********@#---------------------------------------------------------------------------------------------------------------------*%. .
    • ......... ..@#*******@@----------------------------------------------------------------------------------------------------------------------+@...
    • ......... ..@%##%%@@@*-=---------------------------------------------------------------------------------------------------------------------=@...
    • ......... ..:@-===-----------------------------------------------------------------------------------------------------------------------------@:..
    • ...... ..=@---------------------------------------------------------------------------------------------------------------------------------@-..
    • ..+%---------------------------------------------------------------------------------------------------------------------------------@- .
    • ...*#---------------------------------------------------------------------------------------------------------------------------------@=...
    • ........ ...##---------------------------------------------------------------------------------------------------------------------------------@+..
    • ....:........ ...#*---------------------------------------------------------------------------------------------------------------------------------@+..
    • ..@*--*@%.. .. ...#*---------------------------------------------------------------------------------------------------------------------------------@= .
    • .=%----=-#@..... ...##---------------------------------------------------------------------------------------------------------------------------------@-..
    • .*%=-==%@@@@%...... ...+%---------------------------------------------------------------------------------------------------------------------------------@-..
    • .=@--%@*****#@+.. . ...=@---------------------------------------------------------------------------------------------------------------------------------@...
    • ..@*#%*******#@@-... ...:@--------------------------------------------------------------------------------------------------------------------------------=@...
    • ..=@@*****#@#---*@+...... ...@=------------------------------------------------------------------------------------------------------------------------------=*@...
    • ...*@****%%------+%@@-.... ..%*=------------------------------------------------------------------------------------------------------------------------------%=...
    • ...+@###@-=---%@#***#@@*....... ..-@-----------------------------------------------------------------------------------------------------------------------------=-@....
    • ...@@%*--=-@%*****#@#=*@@#-.......@=-----------------------------------------------------------------------------------------------------------------------------*%...
    • ...*@%---*@*****#@-=---@**#@@@@@@@@-----------------------------------------------------------------------------------------------------------------------------@-...
    • .....#@#-#%*****@==---@#*****@+==-@+=--------------------------------------------------------------------------------------------------------------------------*@...
    • ....+@@@****#@----*@******@----+@---------------------------------------------------------------------------------------------------------------------------@....
    • ....:%@@#*#@=---%%******@+----#@-------------------------------------------------------------------------------------------------------------------------@+....
    • ......:%@@@@*--+@******%@==---%%-----------------------------------------------------------------------------------------------------------------------%%.....
    • .......=#@@@@@%%##**#@@%**=%@-=-------------------------------------------------------------------------------------------------------------------%#......
    • ............:-=+*#****=:.=@==-----------------------------------------------------------------------------------------------------------------%#. ...
    • ............@@-=------------------------------------------------------------------------------------------------------------==@=....
    • ..:@%------------------------------------------------------------------------------------------------------------@%....
    • .....@@=-------------------------------------------------------------------------------------------------------@@......
    • .....+@%=-=----------------------------------------------------------------------------------------------=#@*........
    • .. ..=@@*-----------------------------------------------------------------------------------------=#@@*...........
    • . ....:#@@*=-=--------------------------------------------------------------------------=--=*@@%=.........
    • ..........+@@@#=--=-----------------------------------------------------------------=#@@@%- .....
    • .....@-+#@@@%#+=---------------------------------------------------=+*%@@@@#+=---@.......
    • ...@-=------=@#%@@@@@%*+==--------------------------==+*#%@@@@@%*=:..@---------%-...
    • ..:@---------@:........::-=+*##%%@@@@@@@@@@@@%%##*+=-::..............@---------#-. .
    • ...@-=-------@.. .......... .. .......... .... ... . ....#*--------@....
    • ...#%-------*@........ . . .. . . . . . .....@+=-----%*....
    • ...@%-----+@:... ....*@#+=+@=.....
    • ....-@%#%@@... .......:.....
    • ............. ... ... """
    • #meow! ^_^
Code
Diff
  • func gradeCalc(_ score: Int) -> String {
      (0...100~=score) ? String(Array("FFFFFFDCBAA")[score/10]) : "Not a grade" 
    }
    
    
    
    • func gradeCalc(_ score: Int) -> String {
    • (0...100~=score) ? ["F","F","F","F","F","F","D","C","B","A","A"][score / 10] : "Not a grade"
    • (0...100~=score) ? String(Array("FFFFFFDCBAA")[score/10]) : "Not a grade"
    • }
Code
Diff
  • extension String {
        func insert(_ value: String, interval: Int) -> String {
            guard interval > 0 && interval < count else { return self }
            let chars = Array(self)
            var result = ""
            var i = 0
            while i+interval<count {
                result.append(String(chars[i..<min(count,i+interval)])+value)
                i += interval
            }
            result.append(String(chars[i..<min(count,i+interval)]))
            return result 
        }
    }
    
    • extension String {
    • func insert(_ value: String, interval: Int) -> String {
    • guard interval > 0 && interval < count else { return self }
    • let chars = Array(self)
    • var result = ""
    • var i = 0
    • while i+interval<count {
    • result.append(String(chars[i..<min(count,i+interval)]))
    • result.append(value)
    • result.append(String(chars[i..<min(count,i+interval)])+value)
    • i += interval
    • }
    • result.append(String(chars[i..<min(count,i+interval)]))
    • return result
    • }
    • }
Code
Diff
  • sumNechet = (a, b) => (b/2).toFixed()**2;
    • //Крюков Кирилл
    • function sumNechet(a, b) {
    • var answer = 0;
    • for (var i = a; i <= b; i++){
    • if (i % 2 != 0){
    • answer += i;
    • }
    • }
    • return answer;
    • }
    • console.log(sumNechet(5,15));
    • sumNechet = (a, b) => (b/2).toFixed()**2;
Code
Diff
  • const tab = (f, a, b, h) => {
     let sum = 0;
      for (let x = a; x <= b; x +=h){
        sum += f(x); //Filippov Ilya
      }
      return sum
    }
    • const tab = (f, a, b, h) => {
    • let sum = 0;
    • for (let x = a; x <= b; x +=h){
    • sum += f(x); //Filippov Ilya
    • }
    • return sum
    • }