|
03/13/03: Wooohooo!*does a happy Snoopy dance* Do you know why I'm celebrating? I'm celebrating because I finally, finally get to actually work on my project after God knows how long! Yay! This is why I'm working on the log on a Thursday night like the loser I am--so I can continue working on my actual project in school tomorrow. Anyway, quickly now, I've figured out a way to organize the exhibits so that I can place them where they should go in the museum. It's another case of the program reading in a text file and creating this rather complicated organizational structure containing structs, arrays, and linked lists. Basically, there's an array (called struct Wing) of four structs (called Wing Wallspace[4]) that contain the names of the four different 'wings' of the museum (Social Eras, the Arts, the Wars, and Technological Innovations) and a pointer to four arrays of different structs. These second level arrays of structs (called struct Subsect) contain the names of the different rooms in each wing, and each of the structs in these four arrays also contains a pointer to a third type of struct. This third struct (called struct Space) holds four integers (int x1, y1, x2, and y2), the two (x,z) points that define a section of wall that an exhibit can occupy, and a pointer to the next struct that contains another section of wall that can be written on. The linked list is arranged from the largest section of wall to the smallest section of wall in each room. I plan to have the program take the first struct in the linked list (which would define the largest section of unbroken wall in the room) and place the exhibit in the middle of the wall, breaking the wall into two pieces. The program will then divide the previous struct into two structs defining the unbroken sections of wall on either side of the newly-placed exhibit and re-link this structs into their proper order in the linked list. The reason I'm doing it this way is to hopefully place the exhibits in as evenly-spaced-out a manner as possible. A diagram of what I'm talking about organizational is shown below. You can click on the image to see a larger one: I've already written the text file that the program has to read in as well as the function that is supposed to read in the text file and create the array of structs and linked lists. However, I haven't gotten a chance to test to input yet, so I don't know if it works. That is what I hope to devote my time to tomorrow. So, see you then!
|