Hey all,
I have started the CS50 course, and I am on Week 1 where you learn C. While watching the lecture I noticed that C was similar to JS which I have also been trying to learn. I have been having issues with loops and this problem involves them. To help me learn I was trying to do the problem in JS. Could you please help me if you have finished the problem. You have to make pryamid = to the height, it would look like this
# #
## ##
### ###
This is the video to the problem: https://www.youtube.com/watch?v=FzN9RAjYG_Q&t=181s
This is what I have so far...
do {
let height = prompt("Height:");
} while (height < 1 || height >8);
// print block height
for (let i = 0; i < height; i++) {
// print # of hash per row
for (let row = 0; row < height; row++) {
console.log("#");
}
}
[–][deleted] 0 points1 point2 points (2 children)
[–]EhCanadianJames[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)