Ad
  • Custom User Avatar

    maybe you forgot to add '\n'

  • Custom User Avatar

    expected:< [ ],>, but was:< [],> what is a problem with that

  • Custom User Avatar

    exaaactlyyyy😡

  • Custom User Avatar

    Now it says:

    Build a pyramid-shaped tower, as an array/list of strings

  • Custom User Avatar

    I have done all the floors correctly but the empty space thought.

  • Custom User Avatar

    Thank you @benjaminzwhite about the Issue tage. Need to mention that the code I wrote len(x) == len(floor) -2 was not the code that give me the correct built as I write it and I am sure that I will git the error. And Bro you are 1kyu !!

  • Default User Avatar

    Hi @Rian1munassar and welcome to Codewars!

    Please don't use Issue tag - it is for serious problems with the kata; not problems with your code.

    Your current solution that I can see has a few problems, so I doubt that you "have done all the floors correctly" - in fact currently it won't work due to this line: len(x) == len(floor) -2 which will give you a TypeError: object of type 'int' has no len() error.

    In any case, I must close this Issue as there doesn't seem to be a problem with the Python kata. If you would like help with solving katas, you can join the Codewars Discord - there is a #help-solve channel where you can ask for some hints.

  • Custom User Avatar

    I have done all the floors correctly but the empty space thought.

  • Default User Avatar
  • Custom User Avatar

    Too challenging for a 6 kyu, should be corrected

  • Custom User Avatar

    Lua version:

    local star = '*'  
    local space = ' '
    
    function generate(nFloors, block_w, block_h)
        local function gen_tower(n)
            if n==1 then return {star:rep(block_w)} end
            local pin = gen_tower(n-1)
            for i=1,#pin do
              local sp = space:rep(block_w)
              pin[i] = sp..pin[i]..sp
            end
            pin[#pin+1] = star:rep(block_w*(2*n-1))
            return pin
        end
      local tower = gen_tower(nFloors)
      local result = {}
      for _, v in ipairs( tower ) do
        for j=1, block_h do
          result[#result+1] = v
        end
      end
      return result
    end
    
    -- test
    for _, v in ipairs( generate(3,2,3) ) do print(v) end
    for _, v in ipairs( generate(6,2,1) ) do print(v) end
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    It looks like it doesn't know the function replaceAll() for JavaScript...

  • Default User Avatar

    Can see it, if it were inferred, but inferrence from reading code is not in the description of the task either. Just seemed like the kind of problem a 1kyu might see as trivial, but a near-complete newcomer could absolutely trip over; This is expected to be done by users ranked at only 7 kyu, after all.
    Thanks for editing so the noobs can focus on practicing their code rather than practicing interpreting an instruction with multiple potential interpretations.

  • Custom User Avatar

    It's already in the description, and you can see that in the sample tests too.

    Either way, added it in the text.

  • Loading more items...