Using Comments: As previously discussed, it is good practice to use descriptive names for functions and parameters, because it makes it easier to understand what's going on in your code, both for you and anyone else who is reading it. But names by themselves can't always convey all the necessary information, and so that's where "comments" come in. A comment code block is a special code block that is ignored when RoboBlockly (or other programming software) runs the program. It is there simply to allow the programmer to annotate the code, giving the reader a better sense of what it does (or is supposed to do). It also is a helpful reminder for the programmer--what seems completely clear when you write it is often not so clear at a later date. In RoboBlockly the comment code block is available in the "Text" tab menu. It looks like this: It's usually not helpful to put a comment before every line of code, but it is good practice to put a comment at the beginning of major sections (so the act like headings) and before complicated lines of code.
|
Grid Size: S M L | Simple View: | MinView: |
|
Coord: x-axis y-axis | Grid Lines: x-axis y-axis | |||
Grid: | 12x12 inches | 24x24 inches | 36x36 inches | |
72x72 inches | 96x96 inches | 192x192 inches | ||
1x1 inches | 2x2 inches | Fraction: | ||
xy-Range: | ||||
|
||||
|
||||
Quad: | 1 Quadrant | 4 Quadrants | 1&4 Quadrants | |
Units: | US Customary | Metric | Ruler: |
Labels: |
|
|
|
Font
px
|
|
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
|
Some of the code from Lesson 8.6 has been pre-placed in the Workspace, along with a few sample comments. Add a few more comments as appropriate. |
|
|
|||||||||||
|
|||||||||||