![]() ![]() That is, the first unconnected point in the original puzzle is changed into a connected dot in the new puzzle. There is one producer method for DotPuzzle: a puzzle’s connectOneMoreDot() method makes a new DotPuzzle that has the same dots as the original puzzle, but with one more connected point. The Dots in each list should be stored in the order the have been or should be connected. The abstract state for a DotPuzzle is thus two lists of dots: More precisely, a DotPuzzle keeps track of which dots in a puzzle have been connected and which remain to be connected. ![]() A DotPuzzle manages a bunch of Dots, each of which contain a location in cartesian coordinates (ie, a CGPoint) and its label (a number). Model: DotPuzzleĪt its core, the program’s model is connect-the-dots puzzle, which we represent as a DotPuzzle ADT. These three concepts will be represented by DotPuzzle, GraphView, and ConnectTheDotsController, respectively. Your app should also support zooming and panning of the puzzle, as well as a button to allow the user to select the puzzle to show.Īs usual, we begin by designing the model for the program, and then consider the custom view and view controller. (Note that dots 0 and 5 almost entirely overlap, so even though it looks like the first line drawn connects 5 to where dot 1 was originally, is actually drawn between the locations of dot 0 and dot 1.)Īfter all dots have been touched, all of the edges should be highlighted (ie, appear thicker and in a different color). The user continues to touch the dots in numeric order, and lines are drawn to connect the dots that have already been touched, as shown in the sequence above as the user clicks on 0, 1, 2, … When the user touches that dot, it disappears and the next one in the sequence becomes highlighted. The next dot to touch is highlighted in a different color. In more detail, you will present to the user a bunch of numbered dots, as in the first panel below: Here’s a view of the final product (although you are always encouraged to make any reasonable design choices in how your program looks and behaves, as long as it meets the basic standards of the assignment…): It should be designed primarily for an iPad, and work properly in both portrait and landscape modes, although it should also be useable on an iPhone. Overviewīuild a connect the dots program. Details on doing that can be found it Part 6 of the GitLab Tutorial. You will need to set up one of your Gitlab projects to be shared with both partners. I’ll do my best to satisfy all requests.It’s also fine for one of you to attend your partner’s lab section. It will be easiest to work with someone in your own lab section, but I won’t require that.Otherwise I will pair you up with a partner. If you would like to work with a specific person, please fill out this form by 11:30am on Thursday.
0 Comments
Leave a Reply. |