my dog learned polymorphism*
The moose likes Programming Diversions and the fly likes ascii pine trees Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "ascii pine trees" Watch "ascii pine trees" New topic
Author

ascii pine trees

justin marshall
Greenhorn

Joined: Oct 08, 2003
Posts: 5
hi,
this is a code to print a pine tree. It just prints one big tier for any number. It works ok for one tier.
But how do I make look like this one?
*
***
*
***
*****
*
***
*****
*******
|
-----+-----

For example, if you input 3 you get 3 tiers in the tree. Base of tree is always 4 dashes wider then the bottom tier of the tree.

This is what I have so far:
justin marshall
Greenhorn

Joined: Oct 08, 2003
Posts: 5
sorry but the pine tree got messed up.
anyway...how do I make look like this one?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
This seems to work OK, but there's probably simpler ways
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This isn't homework, is it?
justin marshall
Greenhorn

Joined: Oct 08, 2003
Posts: 5
no, no it's not homework.
I learn by example. I learned C that way.
thanks for asking though.
justin.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ascii pine trees
 
Similar Threads
instanceOf
Can someone fix me?
instanceOf??
Pyramid Printing Problem
Please Help