Computer Science Canada Irregular shape. |
Author: | MossyMossy [ Mon Nov 09, 2009 1:58 pm ] |
Post subject: | Irregular shape. |
I need to write a turing program that takes 4 random points to form an irregular shape. It will then fill in the shape wiht asterisks so it becomes solid. A loop is required. example: please enter the row cordinates for pt 1 (upper left): please enter the col cordinates for pt 1 (upper left): please enter the row cordinates for pt 2 (upper right): please enter the col cordinates for pt 2 (upper right): please enter the row cordinates for pt 1 (lower right): please enter the col cordinates for pt 1 (lower right): please enter the row cordinates for pt 1 (lower left): please enter the col cordinates for pt 1 (lower left): assume that the 4 points entered will form a proper irregular shape. like this: ![]() This is a valid shape and must be filled with asterisks. ![]() I will be working on this after school is finished, but I need help with this, its too confusing atm, and i will be looking threw tutorials when i get home. thanks. |
Author: | apomb [ Mon Nov 09, 2009 2:02 pm ] |
Post subject: | RE:Irregular shape. |
since you're dealing with coordinates, Text.Locate() will be useful. if you have any code to begin with, that would be beneficial to others who want to help you. |
Author: | MossyMossy [ Tue Nov 10, 2009 3:53 pm ] | ||
Post subject: | Re: Irregular shape. | ||
MossyMossy @ Mon Nov 09, 2009 1:58 pm wrote: I need to write a turing program that takes 4 random points to form an irregular shape. It will then fill in the shape wiht asterisks so it becomes solid.
A loop is required. example: please enter the row cordinates for pt 1 (upper left): please enter the col cordinates for pt 1 (upper left): please enter the row cordinates for pt 2 (upper right): please enter the col cordinates for pt 2 (upper right): please enter the row cordinates for pt 3 (lower right): please enter the col cordinates for pt 3 (lower right): please enter the row cordinates for pt 4 (lower left): please enter the col cordinates for pt 4 (lower left): assume that the 4 points entered will form a proper irregular shape. like this: ![]() This is a valid shape and must be filled with asterisks. ![]() I will be working on this after school is finished, but I need help with this, its too confusing atm, and i will be looking threw tutorials when i get home. thanks. I followed up another code (the draw box one). and played around with it,
I still get an error, and its really frustating. please help.... ontop of that. Its so confusing to fill it with asterisks. (lines) |
Author: | MossyMossy [ Wed Nov 11, 2009 12:03 am ] |
Post subject: | Re: Irregular shape. |
still cant get it, please help ![]() |
Author: | Tony [ Wed Nov 11, 2009 1:00 am ] | ||
Post subject: | RE:Irregular shape. | ||
Here's the thing, your assignment is talking about rows and columns, as in
You are trying to Draw.Line with pixel positions. You are not going to draw any lines, only use locate and put "*".. (.. prevents the newline character) You can loop over your entire screen using maxrow and maxcol (see documentation) constants, check if that point is inside the shape or not, and draw the asterisk. |
Author: | MossyMossy [ Thu Nov 12, 2009 8:59 am ] | ||
Post subject: | Re: Irregular shape. | ||
Alright, Got it so far, BUT the draw.line function, I created a new set of variables, just for the draw line, and times it by 10. because of the pixels
|