4.2.1 Ghost Codehs File

The CodeHS autograder is strict. To get a 100% on , follow these final checks:

Print "Ghost" 5 times. On the first line, print it with 0 spaces. On the second line, print it with 1 space. On the third line, print it with 2 spaces, etc.

Below is an informative blog post outline you can use to explain the project. 4.2.1 Ghost Codehs

To build the ghost, you must decompose it into three main parts:

However, variations exist. Some versions of 4.2.1 Ghost require you to print a "ghost" that moves across the screen (adding spaces), or to print a decreasing number of ghosts. The constant across all versions is the manipulation of based on conditional logic . The CodeHS autograder is strict

Remember that objects added later will appear "on top" of earlier objects. Make sure to draw the body first, then the eyes, so they don't get hidden! 4. Taking it Further

Ensure you are using setFilled(true) and setColor(Color.gray) (or whatever color the prompt requests). Why This Lesson Matters On the second line, print it with 1 space

To write a robust solution, we want to encapsulate the drawing logic in a . This allows us to easily draw multiple ghosts, which is often a requirement in later variations of the problem.

In the CodeHS curriculum, exercises are grouped into lessons. typically refers to a lesson on If/Else Statements . At this stage in the course, students have usually mastered the basics:

The "Ghost" metaphor likely comes from the idea of a ghost appearing and disappearing, or changing form (case) each time it appears.