diff --git a/.learn/resets/22-Matrix-Builder/app.js b/.learn/resets/22-Matrix-Builder/app.js new file mode 100644 index 00000000..93d285e4 --- /dev/null +++ b/.learn/resets/22-Matrix-Builder/app.js @@ -0,0 +1,6 @@ +// Your code here + + + +// Do not change anything from this line down +console.log(matrixBuilder(5)) diff --git a/.learn/resets/23-Parking-Lot/app.js b/.learn/resets/23-Parking-Lot/app.js new file mode 100644 index 00000000..f9b3c27c --- /dev/null +++ b/.learn/resets/23-Parking-Lot/app.js @@ -0,0 +1,11 @@ +let parkingState = [ + [1, 0, 1, 1], + [0, 0, 0, 2], + [1, 1, 2, 1], + [2, 1, 1, 1] +] + +// Your code here + + +console.log(getParkingLotState(parkingState)) diff --git a/.learn/resets/24-Making-a-ul/app.js b/.learn/resets/24-Making-a-ul/app.js new file mode 100644 index 00000000..d91316ca --- /dev/null +++ b/.learn/resets/24-Making-a-ul/app.js @@ -0,0 +1,40 @@ +let allColors = [ + {label: 'Red', sexy: true}, + {label: 'Pink', sexy: false}, + {label: 'Orange', sexy: true}, + {label: 'Brown', sexy: false}, + {label: 'Pink', sexy: true}, + {label: 'Violet', sexy: true}, + {label: 'Purple', sexy: false}, +]; + +function generateLI(color) { + // Your code here + + return '
  • '+ color.label + '
  • '; + + +} + +function filterColors(color) { + // Your code here +if ( color.sexy === true){ + return true +} +} + +function generateHTMLFromArray(array) { + + let filteredOptions = array.filter((filterColors)); + let LIs = filteredOptions.map(generateLI); + + let htmlString = ''; + return htmlString; +} + +console.log(generateHTMLFromArray(allColors)); +// diff --git a/.learn/resets/25-Techno-beat/app.js b/.learn/resets/25-Techno-beat/app.js new file mode 100644 index 00000000..26cb6b71 --- /dev/null +++ b/.learn/resets/25-Techno-beat/app.js @@ -0,0 +1,32 @@ +// Your code here +function lyricsGenerator (array){ + + let cadenaDJ = ""; + let contador = 0; + for (let i = 0; i<= array.length; i++){ + if (array[i]===0 ){ + contador = 0; + cadenaDJ += 'Boom'; + } + else if (array[i]===1 ) { + contador += 1; + cadenaDJ += 'Drop the bass'; + if (contador ===3){ + cadenaDJ += '¡¡¡Break the bass!!!'; + + + } + } +} +return cadenaDJ; + +} + + + +// Don't change anything below this line +console.log(lyricsGenerator([0,0,1,1,0,0,0])) +console.log(lyricsGenerator([0,0,1,1,1,0,0,0])) +console.log(lyricsGenerator([0,0,0])) +console.log(lyricsGenerator([1,0,1])) +console.log(lyricsGenerator([1,1,1])) diff --git a/exercises/23-Parking-Lot/app.js b/exercises/23-Parking-Lot/app.js index f9b3c27c..37724e8d 100644 --- a/exercises/23-Parking-Lot/app.js +++ b/exercises/23-Parking-Lot/app.js @@ -6,6 +6,30 @@ let parkingState = [ ] // Your code here +function getParkingLotState(parkingState) { + let state = { + totalSlots: 0, + availableSlots: 0, + occupiedSlots: 0 + } + for (let i=0; i'+ color.label + ''; + + } function filterColors(color) { // Your code here +if ( color.sexy === true){ + return true +} } function generateHTMLFromArray(array) { @@ -30,3 +37,4 @@ function generateHTMLFromArray(array) { } console.log(generateHTMLFromArray(allColors)); +// diff --git a/exercises/25-Techno-beat/app.js b/exercises/25-Techno-beat/app.js index d2d5848b..0fc0ece7 100644 --- a/exercises/25-Techno-beat/app.js +++ b/exercises/25-Techno-beat/app.js @@ -1,4 +1,27 @@ // Your code here +function lyricsGenerator (array){ + + let cadenaDJ = ""; + let contador = 0; + for (let i = 0; i< array.length; i++){ + if (array[i]==0 ){ + contador = 0; + cadenaDJ += 'Boom'; + } + else if (array[i]==1 ) { + contador += 1; + cadenaDJ += 'Drop the bass'; + if (contador ===3){ + cadenaDJ += '¡¡¡Break the bass!!!'; + + + } + } +} +return cadenaDJ; + +} + // Don't change anything below this line diff --git a/exercises/25-Techno-beat/solution.hide.js b/exercises/25-Techno-beat/solution.hide.js index 0a3f48bc..138c9bd3 100644 --- a/exercises/25-Techno-beat/solution.hide.js +++ b/exercises/25-Techno-beat/solution.hide.js @@ -17,7 +17,7 @@ function lyricsGenerator(arr) { } } - return finalString + return finalString; } // Don't change anything bellow this line