Closed Thread
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Hellpppp urgently please :)

  1. #11
    annie_xox is offline Newbie
    Join Date
    Feb 2010
    Posts
    11
    Rep Power
    0

    Re: Hellpppp urgently please :)

    ye um its called the game of life its like noughts and crosses but their all zeros in a grid and we have to make it so that some of them turn into ones, but they can only change into a one if there is a one above below or either side of it

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #12
    annie_xox is offline Newbie
    Join Date
    Feb 2010
    Posts
    11
    Rep Power
    0

    Re: Hellpppp urgently please :)

    i am sooo gratefull of all your help guys seriously let me know if theres anything i can help you out with x

  4. #13
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Hellpppp urgently please :)

    Quote Originally Posted by annie_xox View Post
    ye um its called the game of life its like noughts and crosses but their all zeros in a grid and we have to make it so that some of them turn into ones, but they can only change into a one if there is a one above below or either side of it
    This isn't a very accurate description of the rules. You have a large number of cells arranged in a grid. Each cell has a state of 1 or 0, and eight neighbors (horizontal, vertical, and diagonal). For each "step", all the cells update their state based on the state of their neighbors: 3 cells = 1 -> state changes to 1. 2 cells = 1 -> state does not change. Otherwise, state changes to 0.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #14
    annie_xox is offline Newbie
    Join Date
    Feb 2010
    Posts
    11
    Rep Power
    0

    Re: Hellpppp urgently please :)

    yeah sorry this is what ive got so far,
    Code:
    import random
    
    board = [[0,0,0], [0,0,0], [0,0,0]]
    count=1
    
    def board_printer (b):
        for count in range (0,3):
            print(b[count])
        print()
            
    while count != 10:    
        r=random.randint (0,2)
        c=random.randint (0,2)
        if board [r][c]==0:
            board[r][c] = 1
            count=count+1
            board_printer(board)

  6. #15
    annie_xox is offline Newbie
    Join Date
    Feb 2010
    Posts
    11
    Rep Power
    0

    Re: Hellpppp urgently please :)

    however i need to make it so that the noughts can only change to ones if there is a one, above, below or to the right or left of it

  7. #16
    lthreed's Avatar
    lthreed is offline Newbie
    Join Date
    Mar 2010
    Posts
    18
    Rep Power
    0

    Re: Hellpppp urgently please :)

    Have it check for one above it, below it, etc. in an update function then. And WingedPanther is right, life isn't really like naughts and crosses, it's a cellular automata

  8. #17
    annie_xox is offline Newbie
    Join Date
    Feb 2010
    Posts
    11
    Rep Power
    0

    Re: Hellpppp urgently please :)

    yeah im aware of that thanks its just i wasnt sure how to explain it also thats what our lecturer called it, thought you would recognise it more by saying it was similar to the game of life, well thats what ive been told that it is called.

Closed Thread
Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. need help urgently; getting segmentation fault
    By csepraveenkumar in forum C and C++
    Replies: 4
    Last Post: 07-07-2010, 02:32 PM
  2. URGENTLY need help
    By alexrelph in forum C and C++
    Replies: 6
    Last Post: 03-10-2010, 05:02 PM
  3. Need Help Urgently!
    By Bioshox in forum Visual Basic Programming
    Replies: 1
    Last Post: 11-15-2009, 02:15 PM
  4. need help urgently.
    By notpro in forum Java Help
    Replies: 2
    Last Post: 09-15-2008, 07:50 AM
  5. Need help urgently
    By awesome001 in forum Java Help
    Replies: 0
    Last Post: 02-01-2007, 11:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

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