Cart | Help
 You are here: NI Home > NI Developer Zone > NI Discussion Forums Select Community English Français Italiano 日本語 한국어 Español 简体中文 繁体中文 Português (BR)

Member
Posts: 47

# Re: Simple LabVIEW Puzzle Challenge

For the knight puzzle, if someone decides to try it, try to tweak your code once your done to solve the following puzzle:

Puzzle #4A Using the knight regular move on the chess board, make it go through every single tile without ever touching the same one twice. It's a simple exercise of recursion but it might be challenging in LabVIEW. I'll give it a thought as well.

Finally, Darren, if you're really into those mind games, I used to play a lot with the "Binary Arts"(now ThinkFun I believe) puzzles. My favorite games in there were Rush Hour (which would be a pretty amazing challenge to solve in LabVIEW) and Lunar Lockout. I wrote a solver in C for that one and it was capable of genrating new challenges as well.

Active Participant
Posts: 531

# Re: Simple LabVIEW Puzzle Challenge

[ Edited ]

Was that a tumble weed that rolled by?....

OK Knight's tour is admittedly involved, I recently read that Steve Wozniak solved this puzzle using BASIC so it's certainly doable.

Let's shoot for something fun and easy for Simple LabVIEW Puzzle #5.  This one was made famous by Abbott And Costello.  Costello manages to prove to Abbot three separate ways that 13 X 7 = 28.

The question is how many other number combinations can be made to follow these same simple rules of revised math and what are they?  -SS

Message Edited by ShotSimon on 09-18-2008 11:09 AM

Member
Posts: 47

# Re: Simple LabVIEW Puzzle Challenge

I'm a little too young to have ever watched the show on TV but it is quite funny! I was also surprised by the number of times their maths are actually right in this problem. I counted 22 when using the numbers [10..99] and [1..9] with the numbers between 10 and 20 being the best candidates. I don't know what the rules would be if we picked higher numbers so I limitted myself there. Thanx for the laugh.

Olivier

Active Participant
Posts: 531

# Re: Simple LabVIEW Puzzle Challenge

Do you have LabVIEW code you would like to share?  Judging by the results of the last puzzle you could be the only contestant.  Happy to make anyone laugh who's willing  -SS

Member
Posts: 47

# Re: Simple LabVIEW Puzzle Challenge

The division is definitely messy but if you need help to understand, go back to movie!
Active Participant
Posts: 531

# Re: Simple LabVIEW Puzzle Challenge

Congradulation OlivierL!   And what is your prize?  Why you get to pick the next Simple LabVIEW #6 challenge.  <insert one man clapping>

Remember keep it fairly simple but fun.  If you choose not to accept this "prize" the automated system will automatically choose one for you

Again thank you for playing.  -SS

Active Participant
Posts: 531

# Re: Simple LabVIEW Puzzle Challenge

Simple LabVIEW #6 is about a taxi cab and what is refered to as the Hardy-Ramanujan Number.  This is the smallest number that can be expressed, two different ways, as the sum of two cubes.

I'm thinking 15mins tops to solve this puppy  Have a nice weekend.  -SS

Active Participant
Posts: 531

# Re: Simple LabVIEW Puzzle Challenge

[ Edited ]

One solution for the Hardy-Ramanujan Number is as follows:

Message Edited by ShotSimon on 09-29-2008 04:07 PM

Knight of NI
Posts: 22,878

# Re: Simple LabVIEW Puzzle Challenge

[ Edited ]

I cringe at the orange wires imposed by the "power of three". I prefer the compound multiply node instead, keeping things all blue.

While Labview does a good job folding your duplicate operations, I would prefer of you would place the constant computations out by a few loops, where the inputs change for the first time.  You are also doing twice too many tests (A^3+B^3 vs. B^3+A^3) that's why you need to check for degenerate solutions.

Here's my alternative. (I am still not sure if you are theoretically guaranteed to get the lowest solution this way.)

Message Edited by altenbach on 09-29-2008 04:12 PM

LabVIEW Champion . Oh, by the way, I work for peanutsKudos .

Knight of NI
Posts: 22,878

# Re: Simple LabVIEW Puzzle Challenge

[ Edited ]

... and here's a version that does not use the outer array:

My VIs have built-in error handling and return "0" if you solution is found (e.g. if the upper limit is too low). It is left to the student to figure out why.

(note the Rube Goldberg construct in my previous version. We can remove the "index array" and tap in the the +1 output nearby instead. We need to keep the "index array" if we want to precompute the cubes in the init loop, and thus avoiding duplicate work, e.g. as follows)

Message Edited by altenbach on 09-29-2008 05:20 PM

LabVIEW Champion . Oh, by the way, I work for peanutsKudos .

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
 My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page