|
GlobalStructs
Data structures doc, inc. Procedures list
Edit the ones you care about, in consultation with your other users This is SRS's understanding, 11/5 Links: TopDown, Jobs, ToResolve, InchStones PipeH[ ]: Horizontal pipes, labels will be 10--49 as needed and offsets 0--PipeHMax PipeV[ ]: Vertical pipes, labels will be 50--99, offsets 0--PipeVMax Content: Yes/No (0xFF/0x00) LastPipe: Last played. A word. MSB indicates horizontal/vertical (0/1). Absolute value indicates the offset in the appropriate array. Squares[ ]: Upper byte indicates Ownership. It will be an ascii character decided in main (either inputted by the player or hardcoded in main). The lower byte will indicate which sides of the square are filled. Form of lower byte will be AABB CCDD. AA is the top (north side) of the square, BB is the right (east) side of the square, CC is the bottom (south side) of the square and DD is the left (west) side of the square. Each two bits will be 11 to indicate a pipe is there or 00 to indicate no pipe. Therefore if the square is complete, the lowerbyte will be 0xFF. rows, cols : Number of squares that can be made. These values are inputted by the user. NOTE: Testing in the lab has revealed that the maximum number of rows is 3 and the maximum number of columns is 10. PipeVMax, PipeHMax : Maximum offset of the pipe arrays. SqrsMax: Maximum offset of the Squares array. Player: Two global variables, Player1 and Player2; each is a word long, consisting of the following elements: xxxxxxxx yyyyzzzz xxxxxxxx = Numeric value of player's ASCII symbol. (For filling in squares.) yyyy = Human or computer. 0000 = human ; 1111 = computer ; default behavior in case of any other value = ???? zzzz = Easy way to check if you're dealing with Player1 or Player2. Should always conform with the labels. 0000 = Player1 ; 1111 = Player2 ; default behavior in case of any other value = ???? Also: If they would be useful to other people who need to use these values, I could create a couple of simple processes to automatically check whether a player is human/computer/etc, saving the trouble of manually bitmasking it every time. Let me know if this would be helpful for you. --Michael New: CurrPlay: Tracks whether Player1 or Player2 is currently active. All zeroes = Player 1 ; All ones = Player 2. Switched between one and the other by Main. boxFlag: Square was just made (or not) . It holds the value 1 if box was changed and 0 if unchanged. //?? Tally scores at end, or labeling output, or both. Score1 and Score2: Tally of the respective players. Main calculates Score1 + Score2 == MaxSquare ? Tally squares as made, end game at Max Squares? Some unresolved issues here: See ToResolve_ Procedures ProcedureMultiply Multiply CLEAN/DONE! ProcedureInitial Initializes "many" Global structures Inptmove- prompts the player to input a move, checks its validity and plays it SmpDivMod Divides, returning Div and Mod results on stack. CLEAN/DONE! |
Sign in to add a comment
On ProcedureInitial I've laid out how I think these global variables should be handled. Feel free to take a look and leave comments on either that page or this one.
I believe we should store the user inputted board size as two global variables. Since essentially all the procedures that deal with data structures will need this information, it makes sense to store it globally (especially since it determines the size of the global arrays).
Thank you Michael!
Quibble: shouldn't it be max number of rows is 3? max number of cols is 10? The main constraint is the height of the little I/O window; Stacey and I have one or more fonts that will allow 4 rows of squares but no more.
What were you basing your 3-10 estimates on? (they do fit, I believe)
Sorry, yeah, its max rows is 3, max columns 10. They're based on the lab computers (for rows) and the number of labels we have (for columns). We can fit more than 10 across on the screen, but we don't have enough 2 digit labels for anymore than that.
ROutput is pretty much done, when in the middle of a game things shift a bit, but when everything is filled in it looks clear again