Search:

Type: Posts; User: camel-man

Search: Search took 0.08 seconds.

  1. Replies
    5
    Views
    1,148

    [SOLVED] Re: Random Generator and 2D Arrays

    if(gameboard[randomx][randomy] == 0)
    {
    gameboard[randomx][randomy] = 1;
    counter++;
    }
    That should be under your randomx and randomy math generators.
  2. Replies
    5
    Views
    1,148

    [SOLVED] Re: Random Generator and 2D Arrays

    You could check to see if a 1 is in that "slot" and if there is already a 1 there, then you should redo the random number generator until it finds an open slot.
Results 1 to 2 of 2