Summary:
This program was designed to analyze the data from the Dice Saving program earlier. What the program does is it opens the text file read mode, Takes the amount of lines in the program and divides that by four. It does that because there are four lines for each roll. It then prints the amount of rolls that it just determined, and closes the file. Then it sets the amounts of sevens and double sixes in the document to 0 so it is ready to search for how many there are. Then while the amount of Lines discovered earlier is greater than the amount of lines scanned it searches for totals of 7 and roll1's and roll2's of 6. Finally it prints out the information it searched for and found.
Issues:
The main issue in this program was getting it to search for the correct thing. The tricky part is that when we wrote to text file, we put a new line after every number entered. So when reading the file we had to search for the number with the new line (\n) included. This confused a lot of people.
Profit:
Just like in the writing program this reading program is useful for learning how to save games. Also it gave us a nice little reminder that we have to be very careful because computers search for exactly what they are told to do and wont assume anything for you.

No comments:
Post a Comment