Day 7: Loops
Last updated
Last updated
Today we will practice arrays and loops. For each exercise except Infinite Loop, make a copy of the .
Pick either one of the Emoji Drawing or Multi-Dice Game exercise and work through from Base to your preferred level of comfort, before attempting the other exercise.
Use loops to create an app that draws emojis into the grey box. See for how to input Emoji on Windows and for how to input emoji on Mac.
See an example of all problems .
Number of Characters
The user will enter a number of characters to display on the screen.
For example, if the user enters 4 they will see this:
Square
The user will enter the dimensions of a square to display on the screen.
Use a loop within a loop and the <br>
HTML tag in your output to create the square.
For example, if the user enters 4 they will see this:
Triangle
The user will enter the dimensions of a triangle to display on the screen.
Use a loop within a loop, a conditional and the <br>
HTML tag in your output to create the triangle.
For example, if the user enters 4 they will see this:
Outline Square
The user will enter the dimensions of a square to display on the screen. The square is outlined by a different character.
For example, if the user enters 4 they will see this:
Center Square
The user will enter the dimensions of a square to display on the screen. The square is outlined by a different character and there is another different character in the center. The app doesn't allow dimensions that will not allow the center character.
For example, if the user enters 5 they will see this:
More dice rolling and guessing! See an example of all problems .
is a reference solution to the Drawing exercises, and is a reference solution for Dice Game exercises. Please only view the reference solution for each exercise after you have attempted the exercise yourself. Note that there are many ways to implement these solutions and the reference solution is only 1 way.