I have a challenge for class and I'm stumped. It's very simple but I just can't seem to wrap my head around it. We must make the serial monitor print this:
**
without using serial print a bunch of times.
I know it involves nested loops but I just can't seem to grasp how to program it.
Can anyone point me in the right direction and offer some guidance?
You can actually do it in one line of code using a single print statement
Were you told that you have to use for loops ?
Don't forget that the loop() function does what it says
How many print statements are you allowed to use ?
You have been told how to write a for() statement, yes?
for(int x = 1; x<=10;x++) {}
The numbers in the statement don't have to be constants like 1 or 10 - they can be expressions using other variables defined outside the statement itself.
Yeah we've learned for loops. Not thoroughly. My course is very basic and hasn't done a whole lot of in depth explaining, picking code apart line by line. A lot of copy/paste, with a little explanation.
I just can't seem to wrap my head around setting the for loop to compare to another variable, haha.