I am building a program tell score for a game of bowling. I have created a doubly linked list of ten frames. Each frame includes three integers - ball1, ball2, and ball3 for the 10th frame only.
For my scoring I need to look back one and possibly two frames to calculate the score, depending on strikes and spares previously thrown.
My question is how do I retrieve the values of those balls?
I'll strip it down to just one very basic example, because if I can figure out the syntax I can implement it throughout my program.
head is a pointer
prev is a pointer in frame
total is a local variable of type int
Any help using this example or a generic one would be great. I am still figuring out how to move within linked lists so any suggestions would be helpful. Thanks for the time