RosettaCode
Scott Rossi
scott at tactilemedia.com
Mon Jul 8 02:30:57 EDT 2013
OK, just so I'm clear, though I thought part of the bragging rights of
these things was to execute the task in as few lines as possible,
regardless of readability. Looking through the various entries (including
the entry you posted), everything looks fairly well formatted/readable. So
on this site, brevity, while encouraged, isn't really the goal, correct?
In fact, it seems convoluted options can be posted alongside concise
options within the same language.
Regards,
Scott Rossi
Creative Director
Tactile Media, UX/UI Design
On 7/7/13 10:20 PM, "Geoff Canyon" <gcanyon at gmail.com> wrote:
>Thanks for contributing!
>
>Hopefully I don't come off quite that harsh... In any case, there doesn't
>seem to be a better way to add a new entry than:
>
>1. Go to the page for 99 bottles.
>2. Click the entry for the language before LiveCode alphabetically --
>Liberty BASIC in this case.
>3. Edit that entry.
>4. Insert the following at the bottom, after a couple CRs:
>
>=={{header|LiveCode}}==
><lang livecode>function beerMe numberOfBottles
> put "XX bottles of beer on the wall" into verseA
> put "Take one down, pass it around" into verseB
> repeat with N = numberOfBottles down to 1
> put replaceText(verseA,"XX",N) & cr & word 1 to 4 of \
> replaceText(verseA,"XX",N) & cr & verseB & cr &
>replaceText(verseA,"XX",N-1) \
> & cr & cr after theSong
> end repeat
> return theSong
>end beerMe</lang>
>
>I generally add a comment that I'm adding LiveCode, and then save. It
>could
>also be done by editing the entry *after* LiveCard alphabetically, and
>putting the LiveCode entry before that entry, with a couple CRs between
>them. Or by editing the whole page, but that would be harder because you'd
>have to search through the markdown to find the right place to put
>LiveCode.
>
>Note that in this case I just modified your code to take an argument for
>the number of bottles just for laughs. If I were optimizing I'd do
>something like:
>
>function beerMe3 numberOfBottles
> repeat with N = numberOfBottles down to 0
> put N && "bottles of beer on the wall" & cr & cr & \
> N && "bottles of beer on the wall" & cr & \
> N && "bottles of beer" & cr & \
> "Take one down, pass it around" & cr after theSong
> end repeat
> return line 3 to -5 of theSong
>end beerMe3
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list