I am doing a c++ project on cows and bulls where the computer has to guess the number. I have a few questions.?
I recently heard of the pigeon hole principle( i am not exactly sure about how to use it)and I am trying to use this to do my programme. Every time my first number is 0123. Based on this I have 14 possibilities.My questions are-
1.I have reduced the sample space considerably by using a tree. But does it help in arriving at the answer?
2.The next number that I use should be only from the sample space or will using some other number give better result?
This is how far I have got. Thanks in advance.
coolkid1093
0
Newbie Poster
Recommended Answers
Jump to PostYour basic problem is if you don't know how to use something, you can't program it. Any algorithm you try to use in a program you need to understand.
Sit down with paper, pencil, and a good description of the principle and work out how it operates. Be sure …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.