Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

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')

MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

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
which is that from?
unknon wn

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question