Exercise 3 · Chapter: Pixel ProjectsRequired+50 XP
Pixel Art Heart
Create a heart shape using a 7x7 grid!
Use "red" for the heart and "white" for the background.
Here's what it should look like:
Hint: store the pattern as an array of strings, then loop through each character!
Don't change the console.log statements at the bottom.
Expected output
7 7 white red red
Need a hint?
3 available · costs 5 XP each
javascript
let pattern = [
"0100010",
"1110111",
"1111111",
"1111111",
"0111110",
"0011100",
"0001000",
];
let grid = [];
// Loop through the pattern
// '1' = "red", '0' = "white"
let __grid__ = grid;
// Don't change below this line
console.log(grid.length);
console.log(grid[0].length);
console.log(grid[0][0]);
console.log(grid[0][1]);
console.log(grid[3][3]);
Output
Run your code to see the output here.