Part 20. Domain Analysis
For interactive programs such as these, we will use the How to Design Worlds recipe. This is our guide for developing most interactive programs, in big-bang, these are called world programs.
There are 2 parts when designing interactive programs, first is that we use pen and paper for the concept and then we then code the whole thing from our analysis.
We are going to design the walking cat program using the recipe. The cat would start at the left edge of the display and walks across the screen. When it reaches the right side, it should just continue walking off screen
The interactive part is that we can use the spacebar key to bring the cat back to the left side.
There are 4 steps in domain analysis
- Sketch program scenarios
- Identify constant information
- Identify Changing information
- Identify big-bang options
First we sketch program scenarios, we would need pen and paper for this one.
These 2 or 3 images shows the states of the program. From this information we should look for the interesting parts. Depending on the complexity of the interface, we many need more than 3 images.
The second step is to look for constant information. This is the information that does not change throughout the progression of the program.
The constants in the program are the width and height on the screen, the cat's y coordinate is not changing and sits at the center. The background image is also not changing. The image of the cat is not changing.
There will be some times that you will forget to include items, just go back and add them to the appropriate list.
The only changing thing across the scenes is the x coordinate of the cat image.
Finally, we can select some functions that would fulfill the constraints passed on the scenes. In Dr. Racket, we need to select the functions of the big-bang primitive that would fulfill the requirements specified.
Mga Komento
Mag-post ng isang Komento