PaulG. Posted April 23, 2008 Report Share Posted April 23, 2008 I like looking at how other code is written. But what I really liked were the comments that follow the LabVIEW version. "Wow!! That's wonderful!! I've never seen an exotic code as like this!!" (sniff) LabVIEW is "wonderful" and "exotic". (sniff) Quote Link to comment
Francois Normandin Posted April 23, 2008 Report Share Posted April 23, 2008 QUOTE (PaulG. @ Apr 22 2008, 01:42 PM) (sniff) LabVIEW is "wonderful" and "exotic". (sniff) Although the 3 stars are truely disappointing... I guess that's to be expected from non-G believers. Anybody has a HTML version of this: "99 bottles of :beer: on the wall, 99 bottles of :beer: . Take one down and pass it around, 98 bottles of :beer: on the wall. 98 bottles of :beer: on the wall, 98 bottles of :beer: . Take one down and pass it around, 97 bottles of :beer: on the wall..." Download File:post-10515-1208902763.vi Quote Link to comment
Justin Goeres Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (normandinf @ Apr 22 2008, 02:25 PM) http://lavag.org/old_files/post-10515-1208902763.vi'>Download File:post-10515-1208902763.vi That implementation doesn't catch the special cases at N=1 and N=0 bottles of beer on the wall. I would humbly suggest that if anybody from LAVA submits a new example to that site, it would be cool if the credit was for all of LAVA. :thumbup: If Michael's OK with that, of course. Quote Link to comment
orko Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (Justin Goeres @ Apr 22 2008, 04:08 PM) That implementation doesn't catch the special cases at N=1 and N=0 bottles of beer on the wall.I would humbly suggest that if anybody from LAVA submits a new example to that site, it would be cool if the credit was for all of LAVA. :thumbup: If Michael's OK with that, of course. What about this? I wanted to show a little more off about the features of LabVIEW, and generate the lyrics *exactly* (with plurality/case of "No more", etc), since neither of the other ones do... Download File:post-3266-1208906140.vi Quote Link to comment
crelf Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (Justin Goeres @ Apr 22 2008, 07:08 PM) I would humbly suggest that if anybody from LAVA submits a new example to that site, it would be cool if the credit was for all of LAVA. The entry would have to pass LAVAcr requirements of course Quote Link to comment
Justin Goeres Posted April 24, 2008 Report Share Posted April 24, 2008 Can't stop now! Here's mine. Like orko's, this generates canonical lyrics. Credit where due: I started from normandinf's fine work. Attached VI: Download File:post-2992-1208907382.vi EDIT: After a few of us have a go at this, we should have a poll to decide which version to submit. Quote Link to comment
orko Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (Justin Goeres @ Apr 22 2008, 04:37 PM) Can't stop now! Here's mine. Like orko's, this generates http://www.99-bottles-of-beer.net/lyrics.html' rel='nofollow' target="_blank">canonical lyrics. Good job Justin. Since you gave me props, I won't point out the two unneeded linefeed at the end PS. It's the Perl in me coming out again... hehe Quote Link to comment
Justin Goeres Posted April 24, 2008 Report Share Posted April 24, 2008 Here's another whack at it, with a bit less duplicated code. It also trims the two extra linefeeds at the end, for those who are counting . Attached VI: Download File:post-2992-1208912496.vi Quote Link to comment
Francois Normandin Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (Justin Goeres @ Apr 22 2008, 08:57 PM) Here's another whack at it, with a bit less duplicated code. It also trims the two extra linefeeds at the end, for those who are counting .markermovement.pdf Attached VI:DyRASS.vi I sure like this one best so far... I think it's very tight coding! :thumbup: Quote Link to comment
Justin Goeres Posted April 24, 2008 Report Share Posted April 24, 2008 Well, look who's gone all OCD on this . Not as clean & purdy as the previous one, but manages to use Interleave 1D Arrays and some OpenG functions. :ninja: Attached VI: Download File:post-2992-1208914716.vi EDIT: That's it for tonight for me. Quote Link to comment
Justin Goeres Posted April 24, 2008 Report Share Posted April 24, 2008 I lied. One more . Why just sing it, when we can simulate it?! Attached VI: Download File:post-2992-1208924348.vi EDIT: Cleaned up the redundant Queue Status and reposted. I'm treating this thread like an ad hoc code repository . Quote Link to comment
Aristos Queue Posted April 24, 2008 Report Share Posted April 24, 2008 As much as I appreciate the queue version, it's a bit complex. And I would point out that percent codes are confusing and string formatting is slow. I'd offer this version, which uses string subsets and string concatenation... Note that I could avoid the Trim Whitespace if I used a case structure instead of a decision node, but I thought being able to see all the frames was more important. Quote Link to comment
orko Posted April 24, 2008 Report Share Posted April 24, 2008 Here's another version. I thought, heck... might as well show off clusters Plus I thought this was a lot easier to follow than my last one. Download File:post-3266-1208946486.vi Quote Link to comment
crelf Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (Aristos Queue @ Apr 23 2008, 01:27 AM) I'd offer this version, which uses string subsets and string concatenation... What, no LVOOP?!? I was expecting a Bottle class with "take one down" and "pass it around" methods... QUOTE (Justin Goeres @ Apr 22 2008, 11:48 PM) I lied. One more . I really like the queue-based method - it's a bit outside the box. That said, I think the spirit of the site is to compare the simplicities of languages and this might confuse people a little. That said, I'd like to see a flat entry (like all the other ones here) as well as a couple of other methods (queue, OO, ...) Quote Link to comment
Justin Goeres Posted April 24, 2008 Report Share Posted April 24, 2008 QUOTE (crelf @ Apr 23 2008, 05:44 AM) What, no LVOOP?!? I was expecting a Bottle class with "take one down" and "pass it around" methods... I considered doing exactly that, but like AQ I thought it was important to have all the code (or as much of it as possible) visible in a screenshot. Stupid LVOOP and its pesky encapsulation... QUOTE I really like the queue-based method - it's a bit outside the box. That said, I think the spirit of the site is to compare the simplicities of languages and this might confuse people a little. That said, I'd like to see a flat entry (like all the other ones here) as well as a couple of other methods (queue, OO, ...) I agree. The queue one came to me in the moments between crawling into bed and falling asleep, and I felt like I had to get up and get it out before I could nod off. Some of the simpler ones are straightforward enough that I think non-dataflow people might be able to understand them a little. The queue version, not so much. QUOTE (Aristos Queue @ Apr 22 2008, 10:27 PM) uses string subsets and string concatenation Golf clap for these little tricks: even if it is in fairly serious need of commenting for the unwashed mashes . Quote Link to comment
PaulG. Posted April 24, 2008 Author Report Share Posted April 24, 2008 You guys are the best. But now I can't get that stupid song out of my head. Quote Link to comment
LAVA 1.0 Content Posted April 25, 2008 Report Share Posted April 25, 2008 QUOTE (PaulG. @ Apr 23 2008, 03:12 PM) You guys are the best. But now I can't get that stupid song out of my head. I don't have time to develop this idea myself but I'll toss it out there anyway. I think the code would appear much simpler while also demonstrating LV's natural strength if sub-VI's with good icons were used for each phrase of the song with names like; XX_Bottles_of_Beer_on_the_Wall - icon of wall of beers (which in-turn calls ...) Bottles_of_Beer - icon of a bottle of beer Take_One_Down - icon of beer being taken down Pass_It_Around - icon of beers being passed The loop would "look" like the song and in execution highlighting it could act ou the song. And to give it that extra "LAVA-twist" add scripting to change the icon of "Pass_It_Around" to animate the passing. Now I challenge someone to do THAT in "C". :thumbup: Ben Quote Link to comment
Aristos Queue Posted April 26, 2008 Report Share Posted April 26, 2008 QUOTE (neB @ Apr 24 2008, 07:21 AM) I think the code would appear much simpler while also demonstrating LV's natural strength if sub-VI's with good icons were used for each phrase of the song with names like; How about just showing off LV's UI integration? Zero case structures, and the only subVI is "Trim Whitespace.vi". :-)Download File:post-5877-1209146216.vi Quote Link to comment
Phillip Brooks Posted April 26, 2008 Report Share Posted April 26, 2008 QUOTE (neB @ Apr 24 2008, 08:21 AM) I think the code would appear much simpler while also demonstrating LV's natural strength if sub-VI's with good icons were used for each phrase of the song with names like;The loop would "look" like the song and in execution highlighting it could act ou the song. And to give it that extra "LAVA-twist" add scripting to change the icon of "Pass_It_Around" to animate the passing. http://forums.lavag.org/Transparent-Free-Text-on-Block-Diagram-t3866.html&st=15&p=18731#entry18731' target="_blank">Part of the work is done for you! Quote Link to comment
crelf Posted April 26, 2008 Report Share Posted April 26, 2008 QUOTE (Aristos Queue @ Apr 25 2008, 01:58 PM) How about just showing off LV's UI integration? Zero case structures, and the only subVI is "Trim Whitespace.vi". :-) Wow - that's sure a one helluva constant fold http://lavag.org/old_files/monthly_04_2008/post-181-1209155319.png' target="_blank"> Quote Link to comment
PaulG. Posted April 26, 2008 Author Report Share Posted April 26, 2008 A.Q., that is one of the most blatant examples of "feature creep" I've ever seen. :laugh: Quote Link to comment
Tim_S Posted April 29, 2008 Report Share Posted April 29, 2008 QUOTE (Aristos Queue @ Apr 25 2008, 01:58 PM) How about just showing off LV's UI integration? Zero case structures, and the only subVI is "Trim Whitespace.vi". :-)Download File:post-5877-1209146216.vi Is there scrolling sheet music to go along with this? Quote Link to comment
Aristos Queue Posted April 29, 2008 Report Share Posted April 29, 2008 QUOTE (Tim_S @ Apr 28 2008, 04:43 PM) Is there scrolling sheet music to go along with this? Hm... if you take out the boolean LED and instead put in a round picture ring, you could have a tri-state display. The booleans would use states 0 and 1, and then you could have a third state that is the little red ball that bounces along through the text in time with the music... And if you built the whole thing in LV Real Time, we could make sure that it moves with the rhythm. And then we could have it use hardware to control an actual LED array, built next to some major highway somewhere, and then, we could just post the URL to the Google Street View of that billboard to the to the programming language website that started this whole thing!!! Quote Link to comment
Pollux Posted June 5, 2008 Report Share Posted June 5, 2008 QUOTE (Justin Goeres @ Apr 23 2008, 06:48 AM) I lied. One more tongue.gif.Why just sing it, when we can simulate it?! QUOTE (Aristos Queue @ Apr 25 2008, 07:58 PM) How about just showing off LV's UI integration? Zero case structures, and the only subVI is "Trim Whitespace.vi". :-) could you please save your program for the 8.0 version of LV and pas it to me? I'm highly interested in beer drinking algorithms and songs as well as in led matrices control. Quote Link to comment
jgcode Posted June 5, 2008 Report Share Posted June 5, 2008 QUOTE (Pollux @ Jun 4 2008, 10:13 PM) could you please save your program for the 8.0 version of LV and pas it to me? I'm highly interested in beer drinking algorithms and songs as well as in led matrices control. Hi Pollux Give this a go... it contains the Open G VIs as well in case you don't have them - but you should get them !! Download File:post-10325-1212591987.zip Code is in LV8.0 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.