Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Hints on hoq to create this graph?

by tangent (Parson)
on Feb 13, 2014 at 16:00 UTC ( [id://1074861]=note: print w/replies, xml ) Need Help??


in reply to Hints on hoq to create this graph?

For visually controlling output, have a look at printf

Replies are listed 'Best First'.
Re^2: Hints on hoq to create this graph?
by Ratazong (Monsignor) on Feb 13, 2014 at 16:23 UTC

    Asking Google for ASCII-art will probably bring you an even nicer solution ... but this one will give you the idea...

    print " *****\n". " * *\n". " * O *\n". " * O *\n". " * *\n". " *****\n";

    Rata (assuming the OP has some hidden requirements not posted ... )

    update: Based on the commands available to you, you teacher probably expects you to use an array (of the size (2n+1)(2n+1)), with (n)(n) being the center. Then you should determine the distance from each field to the center (using the pythargoras-formula - that's why you are allowed to use sqrt), and decide based on that distance which character to use for that element - that way you'll get circles.

    Have fun trying!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1074861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found