Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

susanjrobertson Group Title

Anyone doing the Conway's Game of Life? I've started on that and am understanding what is going on with the code provided (*I think*), but am unsure of how to get the random blocks. I tried a for loop to go through the dictionary of block_list, but nothing happens. Any ideas? Here's what I have: for blocks in range(len(self.block_list)): for squares in range(len(self.canvas)): block = Block(Point(x, y), 'red')

  • one year ago
  • one year ago

  • This Question is Open
  1. fjfish Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I haven't tried this exercise myself, but think that all your code will only create block objects and then do nothing with them. What you probably want is random numbers picked from each range, up to the number of points you require, with those blocks in an array? Something like: import random randomPoints = 4 blocks = [] for dummy in range(randomPoints): self.block_list[random.randrange(len(self.block_list)] = # whatever a red point is ... or something like that, this would randomly select 4 points, say and set them to red. Hope this helps

    • one year ago
  2. JonnyTruelove Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    which is that from?

    • one year ago
  3. jibril Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    unknon wn

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.