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
def will_this_work():
    acc=0
    for x in ((),(),()):
        acc+=1
    return acc
def pennies(dollar):
    return 100*dollar
def does_this_work(arr):
    i=0
    while i<len(arr):
        mn=i
        for j in range(i+1,len(arr)):
            if arr[mn]>arr[j]:
                mn=j
        if mn!=i:
            arr[mn],arr[i]=arr[i],arr[mn]
        i+=1
    return arr

Consider an array/list of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the array (true means present).

For example,

[True, True, True, False,
True, True, True, True ,
True, False, True, False,
True, False, False, True ,
True, True, True, True ,
False, False, True, True]

The correct answer would be 17.

Hint: Don't forget to check for bad values like null/undefined

def count_sheeps(sheeps):
    pass

Нужно написать функцию, которая будет подсчитывать площади прямоугольников

На вход (пример):

[[5, 8], [4, 10], [15, 40]] -> [40, 40, 600]

Eng

You need to write a function that will count the areas of squares

Example:

[[5, 8], [4, 10], [15, 40]] -> [40, 40, 600]

def calculate_square_sums(list_squares):
    pass

don't judge

function giveItall(n){
  
  let a = [];
  
  let b = 'abcdefghijklmnopqrstuvwxyz'
  
  for(let i = 0; i <= n - 1; i++){
    a.push(b[i]);
  }
  
  return a;
}

console.log(giveItall(11));
def функция(первое_число, действие, второе_число):
    if действие == '+':
        return первое_число + второе_число
    elif действие == '-':
        return первое_число - второе_число
    elif действие == '*':
        return первое_число * второе_число
    elif действие == '/':
        return первое_число / второе_число
    elif действие == '**':
        return первое_число ** второе_число
    return 'ошибка'

no is in foundations of english and doesn't know how to write normal sentences.

luckily no is a prodigy in coding and knows how to make string arrays in the form of sentences

turn no's arrays into sentences

ex.
["the", "dog", "is", "brown"]
"the dog is brown"

using System;

public class Kata
{
  public static string ArrayToSentence(string[] words)
  {
    // Your code here!!!
  }
}

You will be given a 2d-list which represents forest consistings of 🌲's.
A magick mushroom (🍄) will randomly generate in the forests.

Task

Return the (x,y) coordinates of the magick mushroom in the forst. Return -1 if there are no magick mushroom.

from typing import Any


def find_the_magick_mushroom(forest: list) -> Any:
    for t, tree in enumerate(forest):
        for m, mushroom in enumerate(tree):
            if mushroom == '🍄':
                return t, m
    return -1
import codewars_test as test
from solution import find_the_magick_mushroom
import random

@test.describe("Example")
def test_group():
    @test.it("test case 1: find mushroom coordinates")
    def test_case():
        for n in range(101):            
            forest = [['🌲' for i in range(10)] for j in range(10)] 
            i = random.randint(0,9)
            j = random.randint(0,9)
            forest[i][j] = '🍄'
            test.assert_equals(find_the_magick_mushroom(forest), (i, j))
    @test.it("test case 2: No mushroom found")
    def test_case():                 
        forest = [['🌲' for i in range(10)] for j in range(10)]    
        test.assert_equals(find_the_magick_mushroom(forest), (-1))

kaneki's favourite kata

def ghoul(n):
    result = []
    while n > 0:
        result.append(f"{n} - 7 = {n-7}")
        n -= 7
    for i in result:
        print(i, end='\n')
    return "I'm dead inside ghoul double S+ rang Kaneki Ken"