Build Tower Advanced
---

Build Tower by the following given arguments:
__number of floors__ (integer and always greater than 0)
__block size__ (width, height) (integer pair and always greater than (0, 0))

Tower block unit is represented as `*`

* Python: return a `list`;
* JavaScript: returns an `Array`;

Have fun!
***

for example, a tower of 3 floors with block size = (2, 3) looks like below
```
[
  '    **    ',
  '    **    ',
  '    **    ',
  '  ******  ',
  '  ******  ',
  '  ******  ',
  '**********',
  '**********',
  '**********'
]
```
and a tower of 6 floors with block size = (2, 1) looks like below
```
[
  '          **          ', 
  '        ******        ', 
  '      **********      ', 
  '    **************    ', 
  '  ******************  ', 
  '**********************'
]
```
***
Go take a look at [Build Tower](https://www.codewars.com/kata/576757b1df89ecf5bd00073b) which is a more basic version :)

Difficulty: introductory

Starter code:

def tower_builder(n_floors, block_size):
	

Solutions:
def tower_builder(n, (w, h)):
    return [str.center("*" * (i*2-1)*w, (n*2-1)*w) for i in range(1, n+1) for _ in range(h)]

def tower_builder(n_floors, block_size):
    w, h = block_size
    filled_block = '*' * w
    empty_block = ' ' * w
    tower = []
    for n in range(1,n_floors+1):
        for _ in range(h):
            tower.append( empty_block * (n_floors - n) + filled_block * (2*n -1) + empty_block * (n_floors - n))
    return tower

def tower_builder(floors, (w, h)):
    width = w * (2 * floors - 1)
    return [('*' * i).center(width) for i in range(w, width+1, 2*w) for _ in range(h)]

def tower_builder(n, block):
    w, h = block
    return [f"{'*' * w * (2*i + 1):^{(n*2 - 1) * w}}" for i in range(n) for _ in range(h)]


def tower_builder(n_floors, block_size):
    w, h = block_size
    floors = []
    n = n_floors
    for i in range(n_floors):
        n -= 1
        for j in range(h):
            floors.append(' ' * n * w + '*' * (i * 2 + 1) * w + ' ' * n * w)

    return floors

def tower_builder(n_floors, block_size):
    w, h = block_size
    tower = ['*' * (2*n_floors-1)*w]*h
    base = tower[-1]
    for f in range(1,n_floors):
        base = base[:len(base)-2*w]
        tower += [' '*w*f+base+' '*w*f]*h
    return tower[::-1]

def tower_builder(n_floors, block_size):
    w, h = block_size
    return [(n_floors*w - i*w)*" " + (i*w*2-w)*"*" + (n_floors*w - i*w)*" " for i in sorted(list(range(1,n_floors+1))*h) ]
    # build here


def tower_builder(n_floors, block_size):
    W, H = block_size
    result, maxi = [], (2*n_floors-1)*W
    for i in range(W, maxi+1, 2*W):
        result.extend([('*'*i).center(maxi)]*H)
    return result

def tower_builder(n_floors, block_size):
    tower = list()
    w, h = block_size
    l = (2 * n_floors - 1) * w
    sp = int(l / 2 - w / 2)

    for i in range(n_floors):
        for j in range(h):
            tower.append(' ' * sp + '*' * (l - 2 * sp) + ' ' * sp)
        sp = sp - w

    return tower

import math

def tower_builder(n_floors, block_size):
    w, h = block_size
    stars = w #how many stars at first
    height_count = 0 #count for knowing when next floor
    tower = []    #result
    for i in range(n_floors*h): 
        ground_floor_stars = w*2*n_floors-w #gets how many stars in the bottom floor, intial width times two sides times floors minus width
        spaces = " " * int((ground_floor_stars - stars)/2) #calculates how many spaces for each floor for each side
        floor = spaces + '*'*stars + spaces
        tower.append(floor)
        height_count += 1
        if height_count == h:
            stars += w*2
            height_count = 0
    return tower