Cuzzie's Profile User Rating: -----

Reputation: 72 Whiz
Group:
Contributors
Active Posts:
338 (0.23 per day)
Joined:
16-July 10
Profile Views:
6,158
Last Active:
User is offline Jun 22 2014 04:55 AM
Currently:
Offline

Previous Fields

Country:
MY
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
50
Icon   Cuzzie is a bastard.

Posts I've Made

  1. In Topic: Help with understanding my current coding of boolean array

    Posted 13 Sep 2012

    View Postprogrammingdoesmyheadin, on 14 September 2012 - 01:07 AM, said:

    Okay, I think i've figured it out...
    Except, i just don't know what to put instead of 1,1 considering we dont know how many rows and cols there are? :/ any suggestions?

    
       public static boolean[][] nextGeneration(boolean[][] board1)
        {
            int row=0;
            int col=0;
            boolean [][] newBoard = new boolean[board1.length]
            [board1[row].length];
            
            int count = countNeighbours(newBoard, 1, 1);
            if (count < 2 || count > 3)
            {
                newBoard[row][col] = board1[row][col];
                newBoard[row][col] = false;
    
            }
            else if (count == 2 || count == 3)
            {
                newBoard[row][col] = board1[row][col];
                newBoard[row][col] = true;
            }
            return newBoard;
        }
    
    
    


    DOES THAT ANSWER THE QUESTION THOUGH? :( It compiles but I'm not sure if it answers the question


    You are assigning 0 to both row and col in the method, so that means every time you call the method, you will only be modifying newBoard[0][0].

    View Postprogrammingdoesmyheadin, on 14 September 2012 - 01:18 AM, said:

    is this bit necessary within both if statements or not?

    
     newBoard[row][col] = board1[row][col];
    
    
    


    newBoard[row][col] = board1[row][col];
    newBoard[row][col] = false;
    
    


    The value of board1[row][col] that you assign to newBoard[row][col] will be replaced by "false" straight away.
  2. In Topic: Help with understanding my current coding of boolean array

    Posted 13 Sep 2012

    View Postprogrammingdoesmyheadin, on 13 September 2012 - 11:23 AM, said:

    That's basically what I had done so far but the problem I'm really having with the code is the method ! :/ I don't know how to go about writing it.. I dont even know how to start :(


    Which methods are you having problems with? nextGeneration? countNeighbours? Or something else?
  3. In Topic: Movies you should avoid

    Posted 13 Sep 2012

    Avoid Sucker Punch and Haywire.. worst films I've ever come across!
  4. In Topic: Song of the day

    Posted 13 Sep 2012

  5. In Topic: Games you play after a long time of coding

    Posted 13 Sep 2012

    Well, the last time I played games, I was playing Braid and Plant vs Zombies. Braid was so awesome!

My Information

Member Title:
D.I.C Regular
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

Page 1 of 1
  1. Photo

    Cuzzie Icon

    16 Aug 2010 - 01:59
    It's okay. It doesn't matter who helps. The point is to make the OP understand whatever he's unclear of.
  2. Photo

    Simown Icon

    15 Aug 2010 - 11:30
    Stealing your assistance in Python :P I think we made it clear enough now though :D
  3. Photo

    hannan89 Icon

    15 Aug 2010 - 05:02
    hey
  4. Photo

    Cuzzie Icon

    11 Aug 2010 - 06:02
    Lol! PsychoCoder helped me change my profile name. :)
  5. Photo

    Codebug Icon

    10 Aug 2010 - 18:18
    I thought you're name was orange cat? Perhaps I'm thinking of someone else but I made a connection between your avatar pic and the name orange cat.
Page 1 of 1