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
  • hello :- write("Hello, Prolog!").
    • System.Console.WriteLine("Hello, C#!");
    • hello :- write("Hello, Prolog!").
Code
Diff
  • function returnhundred() {
      return parseInt((4).toString(2))
    }
    • function returnhundred() {
    • return 10 ** 2;
    • return parseInt((4).toString(2))
    • }
Code
Diff
  • {
      function todo() {
        return 'Walk';
      }
      
      // reescrever em ES6
      {
        function todo() {
          return 'Run';
        }
      };
    }
    • function todo() {
    • return 'Walk';
    • }
    • // reescrever em ES6
    • (function() {
    • {
    • function todo() {
    • return 'Run';
    • return 'Walk';
    • }
    • })();
    • // reescrever em ES6
    • {
    • function todo() {
    • return 'Run';
    • }
    • };
    • }
Code
Diff
  • const materia = {
      conteudo: {
        titulo: 'UOL',
      },
      tags: ['São Paulo', 'SP', 'Sudeste', 'Brasil', 'América Latina']
    };
    
    const [,uf, regiao] = materia.tags;
    const {conteudo:{titulo}} = materia;
    • var materia = {
    • const materia = {
    • conteudo: {
    • titulo: 'UOL',
    • },
    • tags: ['São Paulo', 'SP', 'Sudeste', 'Brasil', 'América Latina']
    • };
    • var uf = materia.tags[1];
    • var regiao = materia.tags[2];
    • var titulo = materia.conteudo.titulo;
    • const [,uf, regiao] = materia.tags;
    • const {conteudo:{titulo}} = materia;
Code
Diff
  • function monteCarlo() {
      return new Promise(function (resolve, reject) {
        resolve([{
          titulo: 'UOL - O Melhor conteúdo'
        }]);
      });
    }
    
    async function main() {
    
      // converter para ES6
      const response = await monteCarlo();
      
      return true;
    }
    • function monteCarlo() {
    • return new Promise(function (resolve, reject) {
    • resolve([{
    • titulo: 'UOL - O Melhor conteúdo'
    • }]);
    • });
    • }
    • async function main() {
    • // converter para ES6
    • monteCarlo().then(function(response) {
    • console.log(response)
    • });
    • const response = await monteCarlo();
    • return true;
    • }
Code
Diff
  • class Component {
      constructor(dom) {
        console.log('Parent class constructor executed!');
        this.dom = dom;
      }
      
      onCreate() {
        return true;
      }
    }
    
    class Collection extends Component {
      constructor(dom, bool) {
        return super()
      }
    }
    • class Component {
    • constructor(dom) {
    • console.log('Parent class constructor executed!');
    • this.dom = dom;
    • }
    • onCreate() {
    • return true;
    • }
    • }
    • class Collection {
    • //
    • class Collection extends Component {
    • constructor(dom, bool) {
    • return super()
    • }
    • }
Code
Diff
  • class Component {
      constructor(dom) {
          this.dom = dom;
      }
      
      onCreate() {
        console.log('onCreate from parent class');
        return 'missing';
      }
      
      static on(event, callback) {
        callback();
      }
      
      async emit(event, data) {}
    }
    
    class Title extends Component {
      onCreate(){
        super.onCreate();
        return 'super!';
      }
    }
    
    
    • class Component {
    • constructor(dom) {
    • this.dom = dom;
    • }
    • onCreate() {
    • console.log('onCreate from parent class');
    • return 'missing';
    • }
    • static on(event, callback) {
    • callback();
    • }
    • async emit(event, data) {}
    • }
    • class Title extends Component {
    • onCreate(){
    • super.onCreate();
    • return 'super!';
    • }
    • }
Code
Diff
  • class Component {
      constructor(dom) {
        this.dom = dom;    
      }
      
      onCreate() {
        return this.dom;
      }
    
      
      
    }
    • function Component(dom) {
    • this.dom = dom;
    • this.onCreate = function() {
    • class Component {
    • constructor(dom) {
    • this.dom = dom;
    • }
    • onCreate() {
    • return this.dom;
    • }
    • }
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 title = 'UOL - O melhor conteúdo';
    
    var share = {
      fb: {
        title
      },
      twitter: {
        tweet: title
      }
    };
    • var title = 'UOL - O melhor conteúdo';
    • var share = {
    • fb: {
    • title: title
    • title
    • },
    • twitter: {
    • tweet: title
    • }
    • };