RosettaCode

Richmond richmondmathewson at gmail.com
Mon Jul 8 02:43:53 EDT 2013


On 08/07/13 09:30, Scott Rossi wrote:
> 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.

This, surely, is one of the glories of Livecode . . . one can do things 
the easy way, or the difficult way;

one can use a reduced instruction set or a complete (and convoluted) 
instruction set if one so wishes.

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