Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pyramidOfKing(base, hight) {
- let stoneCounter = 0;
- let marbleCounter = 0;
- let lapisCounter = 0;
- let goldCounter = 0;
- let flourCounter = 0;
- let dcorativeBriks = 0;
- let coreBriks = 0;
- for (let x = base; x > 1; x -= 2) {
- let currentFloorBriks = x * x;
- flourCounter++;
- coreBriks = (x - 2) * (x - 2);
- dcorativeBriks = currentFloorBriks - coreBriks;
- stoneCounter += coreBriks;
- if (flourCounter % 5 !== 0) {
- marbleCounter += dcorativeBriks;
- } else if (flourCounter % 5 === 0) {
- lapisCounter += dcorativeBriks;
- }
- }
- }
- pyramidOfKing(11, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement