function numMinusSeven(num) { if(num <= 0) return 0; return numMinusSeven(num-7) + 1; }
- function numMinusSeven(num) {
let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = []while (num > 0) {num -= 7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.push(num)}return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.length- if(num <= 0) return 0;
- return numMinusSeven(num-7) + 1;
- }
const piramidos = (num) => { if(num <= 0) return '' return piramidos(num-1) + '\n' + 'x'.repeat(num*2-1); } //console.log(piramidos(5))
function piramids(numero){var pisos = [];var espacio = " ";var caracter = "x";var coespacios = numero - 1;for(let i = 0; i < numero; i++){pisos[i]="";var cocaracter = ((i + 1)*2)-1;for(let e = 0; e < coespacios; e++){pisos[i] += espacio;}for(let c = 0; c < cocaracter; c++){pisos[i] += caracter;}coespacios --;}for(let f = 0; f < numero; f++){console.log(pisos[f]);}- const piramidos = (num) => {
- if(num <= 0) return ''
- return piramidos(num-1) + '\n' + 'x'.repeat(num*2-1);
- }
piramids(5);/*var parte = "que";var parte2 = "so";const unir = parte + parte2;console.log(unir);*/- //console.log(piramidos(5))