Search:

Type: Posts; User: javapenguin

Search: Search took 0.12 seconds.

  1. Replies
    8
    Views
    2,551

    Re: Pyramid of Doubling Numbers

    I'll use java code to try to bypass the stupid code formatting so it doesn't show the format instead of showing how to make the format, which is what I'm aiming for.

    String str = "highlight=java";...
  2. Replies
    8
    Views
    2,551

    Re: Pyramid of Doubling Numbers

    Well, hmmm...without arrays,

    Not sure if Integers can have their values reset like this.

    Integer i;
    String str = "";

    for (int x =0, x < 8, x++)
    {
    i = (Integer) Math.pow(2,x); // casting...
  3. Replies
    8
    Views
    2,551

    Re: Pyramid of Doubling Numbers

    Hmmmm..use an array. An array of Strings.

    Get it to print your current value plus all the values you want before it till it gets to 1.

    You want an array with 8 places.

    Also an int array...
  4. Replies
    8
    Views
    2,551

    Re: Pyramid of Doubling Numbers

    Well, perhaps you could have an incrementing for loop and a decrementing for loop.

    The idea here is to use recursion to get it to print x plus all the x/2 till x is 1.

    if num = 1, print 1;
    ...
Results 1 to 4 of 5