Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Printing input word within ascii triangle

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Printing input word within ascii triangle

    So yeah, major n00b question.

    I am tasked with creating ascii shapes. Lame, been there done that. But what I'm having issues with, is that the user is supposed to provide along with the shape and 'size' of the shape, a word, and a specific line of the shape to place that word, while maintaining the shape of whats whats been drawn. IE the user says they want "cat" on line 3 of a triangle so,
         *
        * *
       c a t 
      * * * *
     * * * * *


    now, just hard coding the user answer, to that line is not hard. I want to maintain the integrity of the shape. So if they would have said line 5
         *
        * *
       * * * 
      * * * *
     * c a t *
    I'm thinking along the lines that I will need to parse out the string input into a char value array. But how do I reproduce the format of my shape on that line?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Printing input word within ascii triangle

    What have you done so far? The asterisk/triangle question alone has been asked much on this forum, so a quick search of the forums will lead you along those lines (as well as visiting the similar threads list at the bottom of the page)

Similar Threads

  1. Triangle Printing - Java Program
    By mparthiban in forum Java Programming Tutorials
    Replies: 1
    Last Post: January 5th, 2012, 10:00 AM
  2. 8 bit binary to ascii
    By grahamb314 in forum Algorithms & Recursion
    Replies: 5
    Last Post: May 6th, 2011, 05:22 AM
  3. Triangle printing (for loop)
    By thirdwave in forum Loops & Control Statements
    Replies: 2
    Last Post: December 6th, 2010, 04:07 PM
  4. [SOLVED] Printing Array without printing empty elements
    By CarlMartin10 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 12th, 2010, 02:41 AM
  5. ASCII Triangle
    By physics in forum Loops & Control Statements
    Replies: 1
    Last Post: March 27th, 2010, 06:39 AM