09-09-2008 11:01 AM
09-09-2008 12:19 PM - edited 09-09-2008 12:19 PM
Ok, I'll go first. Here's a brute force approach that discovers the optimal time very quickly. Theoretically this approach could take an extremely long time if the random pulls are infinitely unlucky. I'm guessing some math whiz could come up with a better way to pre-calculate all the possible combinations and just run through those.
Here's a screenshot of the diagram, and the VI (saved in LabVIEW 7.0) is attached below.
P.S. - GAMES magazine is awesome! My favorite puzzles are Cryptic Crosswords and Cartoon Rebuses.
09-09-2008 04:43 PM - edited 09-09-2008 04:43 PM
09-10-2008 09:30 AM - edited 09-10-2008 09:33 AM
Looks like you're the only one to take the challenge. I really like your very simple brute force approach. When I solved the problem I got it stuck in my head to use toggling back and forth between moving two over and one back. I was playing around with logical checks such as 5 & 10 must go together but gave up since it made the vi very complicated.
I plan on creating another solution that generates all possible solutions as you suggested.
Here is my solution, FYI you solved the puzzle much faster than I did using LabVIEW very impressive.
I will post a new puzzle shortly. -SS
09-10-2008 10:49 AM - edited 09-10-2008 10:49 AM
OK LabVIEW puzzle #2 is more challenging and is known as a magic star. I will provide the start to one solution but would like to see someone solve for all solutions.
The rules are similar to a magic square. Using the integers 1-12, each only once, complete the magic star such that each line of four number's sum is equal to the same number 26.
Since this is a harder puzzle I may post a new puzzle before this one is completely solved by someone.
09-10-2008 03:00 PM - edited 09-10-2008 03:02 PM
Here's my solution for the Magic Star. It generated 960 solutions. Since there are over 479 million combinations of the numbers 1-12 in the star, it took this VI a couple of hours to run. Again, I used a brute force approach, but this time I was able to calculate every single possible combination (compared to the random combinations I used in the Bridge Crossing problem). Also, credit partially goes to a permutation VI I found at http://www.fafiles.com/examplevis.php that I used as inspiration in calculating my permutations.
The VI is saved in LabVIEW 8.5 this time, since I used For Loop with Break in my solution.
09-10-2008 03:45 PM
09-10-2008 04:24 PM - edited 09-10-2008 04:25 PM
This is known as a magic star order 6 and has 80 solutions. I think the 960 comes about if you count rotated solutions as different solutions, so you are correct.
It is interesting to note some people solve all 80 with paper and pencil using logic no programming. -SS