BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

Sometimes the program is working perfectly and no improvements are possible, but we still have days left for the project (never happens!), so we could start doing some artsy-fartsy creative modifications.

 

Of course there are others that instead try to learn programming and write/debug code from scratch mostly with the paint tool. Seems like they chose the wrong profession and would have more success with a career in the visual arts. 😄

 

 

 

(Seen here)

 

(Yes, these blue things are stacked sequences. Imagine programming with integers in this color scheme)

0 Kudos
Message 1831 of 2,571
(12,259 Views)

I didn't paint it prettily (you could say neither did the OP in your linked post?) but here was something I found whilst repackaging my code recently...

rg-1.png

I'm actually a little concerned that this isn't equivalent to what I replaced it with, since if the Finalize throws an error it will behave differently, but I think for the Finalize to error there would need to be an earlier error anyway. Hopefully I don't discover this was my carefully written workaround to a problem I've forgotten...

 

And then in another example - RG version

Cooler.lvlib_MessageBuilder (1)_BD.png

and new version

Cooler.lvlib_MessageBuilder.png

I added the FP to show that actually I was previously indexing the entire cluster in order. I don't think I knew about the Cluster to Array node when I first wrote this, so I understand that... but an Express VI instead of Concatenate String, sat right next to a Concatenate String?


GCentral
0 Kudos
Message 1832 of 2,571
(12,251 Views)

While I doubt the algorithm is sound, here's a near literal translation (bottom) of some convoluted code found in the forum.

 

I added a limited amount of comments to guide the eye, but there are plenty more things wrong (well, it works, but at a snails pace :D)

 

 

Message 1833 of 2,571
(12,164 Views)

my very own (very small) rube goldberg

.. but i'm just beginning 😉

yay6.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 1834 of 2,571
(12,093 Views)

@jwscs wrote:

my very own (very small) rube goldberg

.. but i'm just beginning 😉

yay6.png


Oh, you found it!  (Hey, what is the increment doing there? Yeah, auto-increment work on columns too when row is unwired!)  I liked the code over where you posted it!  peruse this thread at your own peril!  I hope you have a sense of humor!  We've all done worse- that is what code reviews are for!  


"Should be" isn't "Is" -Jay
Message 1835 of 2,571
(12,089 Views)

@jeff i read this thread (or parts of it) already, but since it is not in the main labview forum, it often slips my mind .. but never again 😉 because of the email updates i now get

and the humor is what drove me to post here (and to never make that error again)

 

this thread was a good learning experience, the standard beginner error of the select with true and false wired to it for example.

 

(the +1 was for myself and from the other post to be explicit rather than implicit)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 1836 of 2,571
(12,087 Views)

@jwscs wrote:

@Jeff i read this thread (or parts of it) already, but since it is not in the main labview forum, it often slips my mind .. but never again 😉 because of the email updates i now get

and the humor is what drove me to post here (and to never make that error again)

 

this thread was a good learning experience, the standard beginner error of the select with true and false wired to it for example.

 

(the +1 was for myself and from the other post to be explicit rather than implicit)


I actually caught a bug in my code last week using the output of "Value Changed.vim" AND TRUE rather than the output of "Value Changed.vim" AND "Value" to detect a F-T transition.  2017

 

Use Value Changed AND TRUE to detect any value change on a BOOLSmiley Surprised


"Should be" isn't "Is" -Jay
0 Kudos
Message 1837 of 2,571
(12,079 Views)

@jwscs wrote:

my very own (very small) rube goldberg

 


They are probably about equally good. It is likely that the "transpose" is actually not carried out at all, but the output data flagged internally to index the other way. 

0 Kudos
Message 1838 of 2,571
(12,065 Views)

in this case i knew about the "its only a flag" thing, but since the index array gave me the "transposed" columns anyway it was really superfluuous


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 1839 of 2,571
(12,036 Views)

Some people complain that their diagram gets too big, but then they use a screenful of code just to generate an LED level meter. (17 coercion dots, 17 diagram constants, 17 LEDs, 17 comparisons) when all they really need is a small FOR loop the size of a postage stamp and an LED array indicator. The code could even be wrapped into a subVI: I32 in, boolean array out.

 

 

LEDColumns.png

(seen here)

 

 

Message 1840 of 2,571
(11,957 Views)