zby,
You can use only the information outlined by the riddle itself:
- Given: 12 balls identical in appearance
- Given: 11 balls are identical in weight, 1 is not
- Given: A balance scale with 2 sides
- Given: The use of the balance 3 times
- Goal: A set of groupings and weighings that when followed will determine which ball is odd and how it is odd.
I really don't know how else to say it. You are designing a program to solve a problem that is presumably too difficult to solve otherwise. You feed it rules to follow and a desired outcome and it churns away until it has satisified the goal.
| [reply] |
| [reply] |
zby,
If you find the right string you need only print it.
Of course - but that's not the challenge. I have repeatedly indicated you (the human) is not to solve the riddle and then translate that solution to code. The challenge is to start with an objective and rules and figure out how to achieve the objective.
I really don't see how I can be any clearer. I already gave the Challenge: Setting Sun Puzzle example, so let me try another one.
You have a rubik's cube in a given starting position. The goal is to get the rubik's cube into a new desired position (all colors matching on all sides) using only legal moves. The hard part is finding the series of moves that results in the goal being achieved.
You wouldn't find the right series of steps and then write a program that just regurgitates that output. You would write a program that finds the right series of steps for you and tells you how to do it. That is the challenge.
| [reply] |