Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Can't you just generate two random numbers and see how many times it takes until they match?

I think that this really jus test how many attemps until the random generator, generates the same number twice consecutively. Which is also like guessing a number.

1 Answer

Steven Parker
Steven Parker
230,230 Points

This sounds like a fun practice project.

Why don't you give it a shot, and post the results here? Here's another idea: after collecting data from several runs where the computer has to guess it's own number in the first try, then create a similar program where the computer is allowed to re-try until it gets it. It might be interesting to see if (and by how much) the results differ.