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
Code
Diff
  • const results = [
      {materia: {conteudo: {titulo: 'São Paulo'}}, tags: [1, 2, 3]},
      {materia: {conteudo: {}}, tags: [3, 2]},
      {materia: {conteudo: {titulo: 'Rio de Janeiro'}}, tags: [3, 2]},
    ];
    
    for (const {materia: {conteudo: {titulo = 'Brasil'}}} of results) console.log(titulo);
    • let results = [
    • const results = [
    • {materia: {conteudo: {titulo: 'São Paulo'}}, tags: [1, 2, 3]},
    • {materia: {conteudo: {}}, tags: [3, 2]},
    • {materia: {conteudo: {titulo: 'Rio de Janeiro'}}, tags: [3, 2]},
    • ];
    • for (const result of results) {
    • let titulo = result.materia.conteudo.titulo || 'Brasil';
    • console.log(titulo);
    • }
    • for (const {materia: {conteudo: {titulo = 'Brasil'}}} of results) console.log(titulo);
Code
Diff
  • // reescreva usando ES6
    
    var prop = 'myProp';
    
    var obj = {
      [prop]: 123,
      myFunc() {
        return this[prop];
      } 
    };
    
    obj.myProp;
    • // reescreva usando ES6
    • var prop = 'myProp';
    • var obj = {
    • myFunc: function() {
    • [prop]: 123,
    • myFunc() {
    • return this[prop];
    • }
    • };
    • obj[prop] = 123;
    • obj.myProp;
Code
Diff
  • var bg = 'gray'
    
    var css = `
      <style>
      body { 
        background: ${bg};
        color: black;
      } 
      </style>`
      
    • var bg = 'gray';
    • var bg = 'gray'
    • var css = '' +
    • '<style>' +
    • 'body {' +
    • ' background: '+ bg + ';' +
    • ' color: black;'
    • '}' +
    • '</style>';
    • var css = `
    • <style>
    • body {
    • background: ${bg};
    • color: black;
    • }
    • </style>`
Code
Diff
  • // reescreva em ES6
    function main(a, b = 2, c = 3) {
        return a * b * c;
    }
    
    • // reescreva em ES6
    • function main(a, b, c) {
    • if (typeof b == 'undefined')
    • b = 2;
    • if (typeof c == 'undefined')
    • c = 3
    • function main(a, b = 2, c = 3) {
    • return a * b * c;

removed an entire line

Code
Diff
  • def multiply_and_add_one(a, b):
        return a * b + 1
    
    • def multiply_and_add_one(a, b):
    • r = a * b
    • return r + 1
    • return a * b + 1
Code
Diff
  • function digitToText(digit) {
      const nums = {0: 'zero', 1: 'one', 2: 'two', 3:'three', 4:'four', 5:'five', 6:'six', 7:'seven', 8:'eight', 9:'nine'}
      return nums[digit]
    }
    • const nums = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
    • function digitToText(digit) {
    • const nums = {0: 'zero', 1: 'one', 2: 'two', 3:'three', 4:'four', 5:'five', 6:'six', 7:'seven', 8:'eight', 9:'nine'}
    • return nums[digit]
    • }
Code
Diff
  • function sumNechet(a, b) {
      let sum = 0;
      for (let i = a; i <= b; i++) {
        if (i % 2 !== 0) sum += i;
      }
      return sum;
    }
    
    
    
    • function sumNechet(a, b) {
    • let sum = 0;
    • for (let i = a; i <= b; i++) {
    • if (i % 2 !== 0) sum += i;
    • }
    • return sum;
    • }
    • function нечетное(число) {
    • }

Esta solucion es clave, tenela en cuenta pa.

Code
Diff
  • function addArr(arr){
      return arr.reduce((num,acc)=>num+acc,0) || null
    }
    • function addArr(arr){
    • if(arr.length === 0) return null
    • let final = 0
    • arr.forEach(num => {
    • final += num
    • })
    • return final
    • return arr.reduce((num,acc)=>num+acc,0) || null
    • }
Code
Diff
  • -- Code Here
    select*from transactions
    where customer is NULL;
    • --- Code Here
    • -- Code Here
    • select*from transactions
    • where customer is NULL;