Any ideas on how to start?
use strict; use warnings;
Don't think of this as "How am I going to use the commands available to me to do this?" Instead, think "How would I do this with a pen and a sheet of graph paper?" Then use the commands available to you to implement that human algorithm as a computer algorithm.
For example; you would start by laying a sheet of graph paper before you, determining its cell width, and then placing a mark in the top middle square. Then you would move down one row, and place three marks, starting one space to the left of middle. Depending on how "round" you want this bull's eye to be, and how much detail, you would adjust how many spaces to the left to start on each new row, and you would adjust how many marks to place. You might even adjust what type of mark you place. For each new row you repeat this decision making process and marking process. At some point you find yourself halfway done, and begin reversing the process so that each row has fewer marks placed in it, and starts a little closer to the middle. Finally you end near the bottom of the page with a single mark at the middle.
So as you're doing this with pen and graph paper, you are keeping track in your mind where the last row started and finished, so that you can calculate where the next row starts and finishes. You are also keeping track how many rows you have completed so that you know when to begin reducing the width instead of increasing it for each row.
On a computer you would do the same thing; a loop would be used to iterate over the rows, and calculations would be made on each row based on the criteria of where you were in the last row, and how many rows have been completed. You would use that calculation to decide how many marks to place, and where. All of this looping, logic, and calculation can be accomplished with "for" or "while" loops, "if" statements, mathematical expressions, and variables for storing state.
So get started. If you haven't done so already, read through perlintro first. But then, really, get started and see how far you get. You gain nothing by us solving it for you, but you gain a lot by trying yourself, and possibly asking us for clarification on sticking points.
Dave
In reply to Re: Hints on hoq to create this graph?
by davido
in thread Hints on hoq to create this graph?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |