proj3

# proj3 - Project 3 Hints Two phases Complete all plot...

This preview shows pages 1–3. Sign up to view the full content.

4/22/2011 1 Project 3 Hints Two phases Complete all plot* functions. Then set up a loop like the following: while (true) { Get a str . If str is empty, break; while (there are more chars to process in str ) { Get a command . Interpret the command . If there is an error with the command , complain and break; Call the right plot* function for the command . } } Project 3 Hints For most of the plot* functions, you need a loop to visit each slot at a time. Use an offset . for (int i = 0; i < width; i++) { // Is (r, c+i) in the grid? // Do something about the character at (r, c+i). } r,c r, c+1 r, c+2 r, c+3 r, c+w 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4/22/2011 2 Project 3 Hints For *Rectangle functions: Use two offsets . for (int i = 0; i < height; i++) // For each row r+i, { for (int j = 0; j < width; j++) // visit columns in that row. { // Is (r+i, c+j) in the grid? // Do something about the character at (r+i, c+j). }
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 07/06/2011 for the course CS 31 taught by Professor Melkanoff during the Spring '00 term at UCLA.

### Page1 / 3

proj3 - Project 3 Hints Two phases Complete all plot...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online