@majorhang that’s a good and tough question.
At its core, these Challenge Projects are intended to provide less instruction and let you come up with the necessary solutions.
Try to break down the projects into even smaller bits.
Take the second step for example:
— Start of Step 2
Your project is centered on a
Field class. This and the following tasks will describe how the class should function at a high level, and it will be up to you to figure out the implementation in code. As you go, test your code by creating instances of the class and calling its methods.
Field constructor should take a two-dimensional array representing the “field” itself. A field consists of a grid containing “holes” (
O) and one “hat” (
^). We use a neutral background character (
░) to indicate the rest of the field itself. The player will begin in the upper-left of the field, and the player’s path is represented by
Your class should take a single argument representing the field:
const myField = new Field([
['*', '░', 'O'],
['░', 'O', '░'],
['░', '^', '░'],
---- End of Step 2
Now this is a reallly big step. So we can break it down into smaller steps for ourselves
- Let’s start first with the
Field class, do you feel comfortable working with a
class? If not then review classes for a bit.
- Then with classes, we know there are constructors. Look up the syntax to create a constructor, either through a cheatsheet or googling (fwiw, I never remember how to do it, I have to google)
- This constructor should accept a 2D array, do a little brush up on arrays.
- Add the correct parameters to the constructor
- Make up a 2D array and try to create a
Field instance. (or copy it from the step )
- Test that the
Field instance works correctly, and if it doesn’t debug)
You can break down this step even further to go at your own pace, but that’s just a rough example of how seemingly big problems can be deconstructed to be more manageable smaller problems.
And keep posting and asking questions! It’s all part of learning!
Hope that helps!