Jump to content

99 bottles of beer


Recommended Posts

QUOTE (normandinf @ Apr 22 2008, 02:25 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.

Link to comment

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.


Link to comment

QUOTE (Aristos Queue @ Apr 23 2008, 01:27 AM)

:blink: 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, ...)

Link to comment

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. :wacko:

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:


Link to comment

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!!!

Link to comment
  • 1 month later...

QUOTE (Justin Goeres @ Apr 23 2008, 06:48 AM)

QUOTE (Aristos Queue @ Apr 25 2008, 07:58 PM)

How about just showing off
'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? :D

I'm highly interested in beer drinking algorithms and songs as well as in led matrices control.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.