Results 1 to 5 of 5
  1. #1
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Why do the array values change, and why does this print twice?

    I'm stumped again.
    But what the heck! being stumped ain't all that bad.

    JosAH actually showed me how to fix things so fast I decided to delete most of the post.

    Thanks again Jos!
    Last edited by NotTooOld; 06-02-2013 at 05:56 PM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,524
    Blog Entries
    7
    Rep Power
    20

    Default Re: Why do the array values change, and why does this print twice?

    Your method fillGameGrid() is called twice and the other methods have side effects?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Why do the array values change, and why does this print twice?

    Quote Originally Posted by JosAH View Post
    Your method fillGameGrid() is called twice and the other methods have side effects?

    kind regards,

    Jos
    Very good, and very fast! 100% correct. chooseButtons() gets a new set of random numbers each time fillGameGrid() is called. Thanks! And please delete this post so I don't look so dumb.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,610
    Rep Power
    5

    Default Re: Why do the array values change, and why does this print twice?

    Hey, if you can delete posts because they make you feel dumb, I got quite a few I'd like to get rid of.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: Why do the array values change, and why does this print twice?

    Quote Originally Posted by jim829 View Post
    Hey, if you can delete posts because they make you feel dumb, I got quite a few I'd like to get rid of.

    Regards,
    Jim
    It's an easy fix. Being this dumb is not so easy to fix.

Similar Threads

  1. Replies: 1
    Last Post: 04-30-2013, 12:18 PM
  2. Print integer Array values into a single !, showMessagedialog
    By Kadir Karapinar in forum New To Java
    Replies: 5
    Last Post: 12-24-2012, 02:57 PM
  3. Replies: 0
    Last Post: 04-16-2012, 08:35 AM
  4. Replies: 14
    Last Post: 01-22-2011, 02:36 PM
  5. cant print 2d array(giving null values)
    By fneeks in forum New To Java
    Replies: 1
    Last Post: 04-07-2010, 08:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •