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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.