10-14-2012 12:21 PM
You got a working draft version earlier. What else do you need?
Once you fully understand the code and the purpose of all four cases, you could try to come up with ideas to improve it.
Here is a quick cleanup of Lewis's version, eliminating some of the duplicate code that I mentioned earlier. Maybe it is now easier to understand. The original also had one too many iterations. (The typedef is still the same)
As I said, it is possible to create a solution without the use of any case structures.
That would be a good exercise! See how far you get 😄
10-14-2012 12:32 PM - edited 10-14-2012 12:35 PM
And here's a hint to use some of the inherent symmetry in the directions. 😄
10-14-2012 01:01 PM
Thank you!!
I´ll try to modify the code to add more things and I´ll send you for suggestions. 🙂
10-15-2012 09:04 AM
I like the mods. I will hopefully spot things like that in future.
Thanks for the code review
10-15-2012 11:05 AM - edited 10-15-2012 02:58 PM
Just for a very different perspective, an interesting solution involves complex numbers. It always helps to think outside the box. 😄
It is useful to know that a multiplication of complex numbers corresponds to a rotation.
(Less code overall! No case structures! Only a single instance of "replace array subset"! 121 iterations on the FOR loop!, etc.)
Remember, your teacher also reads these forums, so I would not use this directly, but maybe you could use some of the (non-complex) ideas in your solution. You could try to implement something similar without using complex numbers.
10-15-2012 11:46 AM
@altenbach wrote:
Just for a very different perspective, an interesting solution involves complex numbers. It always helps to think outside the box. 😄
It is useful to know that a multiplication of complex numbers corresponds to a rotation.
(Less code overall! No case structures! Only a single instance of "replace array subset"! 121 iterations on the FOR loop!, etc.)
Remember, your teacher also reads these forums, so I would not use this directly, but maybe you could use some of the (non-complex) ideas in your solution. You could try to implement something similar without using complex numbers.
interesting code....good job!
10-15-2012 02:46 PM
That is the best VI I have ever seen!
10-16-2012 01:29 AM
@altenbach wrote:
Just for a very different perspective, an interesting solution involves complex numbers. It always helps to think outside the box. 😄
(...)
Awesome!
Br,
/Roger
10-16-2012 03:53 PM
Thank you very much. I know that my tecaher can see this forum, I´ll change somethings in code.
😄