Skip to content

Commit c58d086

Browse files
committedOct 14, 2020
Fixed Tip and Warning box phrasing for the functions exercises.
1 parent 60dae53 commit c58d086

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed
 

‎src/chapters/functions/exercises.rst

+15-9
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ Rectangles
4545

4646
#####
4747

48-
#. Write a function ``makeSquare(size)`` that returns an ``size`` by ``size``
49-
square of hashes. Use your ``makeLine`` function to do this.
48+
#. Write a function called ``makeSquare(size)`` that returns a ``size`` by
49+
``size`` string of hashes. The function should NOT print each row of the
50+
square. Instead, it must return a single string that contains the entire
51+
shape.
52+
53+
.. admonition:: Tip
54+
55+
#. Call your ``makeLine`` function to create each row of the square.
56+
#. The newline character, ``\n``, will be helpful to you.
57+
#. Do NOT include a newline character at the end of your string.
5058

5159
.. sourcecode:: js
5260

@@ -62,14 +70,12 @@ Rectangles
6270
#####
6371
#####
6472

65-
.. tip::
66-
67-
The newline character, ``\n``, will be helpful to you.
68-
69-
.. warning::
70-
71-
For this and all other functions in these exercises, make sure you do NOT have a newline character at the end of your string. Not only will ``console.log`` add a newline there for you, but having an extra newline at the end will make life harder for you toward the end of the exercises.
73+
.. admonition:: Warning
7274

75+
For each of the shape exercises, do not include a newline character at
76+
the very end of your string. While the final ``\n`` might not be
77+
noticeable for the simpler shapes, including it will make life harder for
78+
you toward the end of the exercises.
7379

7480
#. Write a function ``makeRectangle(width, height)`` that returns a
7581
rectangle with the given width and height. Use your ``makeLine`` function to

0 commit comments

Comments
 (0)
Please sign in to comment.