Page 1 of 1

RosettaCode

Posted: Sun Nov 07, 2021 9:19 pm
by stam
Hi all,

i came across a really useful resource: RosettaCode
Many of you have undoubtedly come across this before, but as i've not seen mention of it in the forums i though i'd post it here.
RosettaCode implements a number of common algorithms across a huge variety of languages, including liveCode, and I've found useful solutions there more than once.

I'd highly recommend this as a resource as the solutions tend to be as concise as possible and often very useful and thought-provoking - as well as having access to the same algorithm in all other languages for comparison.

They have basically set a number of algorithms to be performed in all languages and there is a list of algos still not being done in each language.

For liveCode, the pending algorithms are listed here: https://rosettacode.org/wiki/Reports:Ta ... n_LiveCode
I'll work on some but thought this might be good for the community at large both to consult and to contribute to - quite an interesting site.

Stam

Re: RosettaCode

Posted: Mon Nov 08, 2021 11:00 am
by richmond62
"Tasks not implemented in LiveCode"

Quite bewildering, but, Yes, a good landing place for
those in need of a spot of mental stretching. 8)

Re: RosettaCode

Posted: Mon Nov 08, 2021 3:33 pm
by dunbarx
I could not find "LiveCode" in the long list of programming environments.

Anyway, I thought I would try one of the simpler tasks, right at the top, the "99 bottles of beer". With a field 1 containing the first stanza, in a button script:

Code: Select all

on mouseUp
   put fld 1 into baseText
   put baseText into workingText
   repeat 98
      subtract 1 from word 1 of workingText
      subtract 1 from word 8 of workingText
      subtract 1 from word 18 of workingText
      put return & workingText after basetext
   end repeat
   replace "0" with "No more" in basetext
end mouseUp
Works fine, if a bit brute-force. But I could not publish it because my Safari browser is out of date for them.To get it updated, I would have to change from Catalina to Big Sur. I have heard odd things about LC and Big Sur. Anyone think it is not an issue?

Craig

Re: RosettaCode

Posted: Mon Nov 08, 2021 4:08 pm
by richmond62
Let's go OT . . .
I have heard odd things about LC and Big Sur. Anyone think it is not an issue?
My own experiences with MacOS 11 (Big Sur) were awful (especially re LiveCode),
so I got onto the beta programme for MacOS 12 (Monterey), and all the problems went away.

Now running the stable release of MacOS 12.

But I have a 2018 Mac Mini which does upgrade to MacOS 12.

My advice is that:

1. If your machine will upgrade to MacOS 12, upgrade it.

2. If your machine will NOT upgrade to MacOS 12 stick with MacOS 10.15 (Catalina),
and do NOT touch MacOS 11 (Big Sur) with a 10 foot pole.

Re: RosettaCode

Posted: Mon Nov 08, 2021 5:00 pm
by dunbarx
Richmond.

You of all people will love this about 10 foot poles.

https://www.milesgeek.com/decomposing-n ... ns-culture

Craig

Re: RosettaCode

Posted: Mon Nov 08, 2021 5:11 pm
by richmond62
Wow: interesting stuff.

Although a good Gaelic word comes to mind: Fioch. 8)

Re: RosettaCode

Posted: Mon Nov 08, 2021 8:25 pm
by stam
dunbarx wrote:
Mon Nov 08, 2021 3:33 pm
I could not find "LiveCode" in the long list of programming environments.
erm... the page is already on the LiveCode section, the list is to navigate to all other languages, which is why you won't find LiveCode there lol ;)
Also note the 2nd link is the landing page missing/incomplete algorithms - and this is for the LiveCode language.

If you go to their homepage you can navigate to a link for all items for specific languages. For LiveCode, this is https://rosettacode.org/wiki/Category:LiveCode

It's a great resource for looking for algorithms like how to check if a certain year is a leap year, how to traverse folder structures recursively etc. Many have already contributed, but if people don't know about it, it's no good (much like this great language ;) )

Re: RosettaCode

Posted: Tue Nov 09, 2021 4:30 am
by dunbarx
Stam.

Right you are.

Craig

Re: RosettaCode

Posted: Tue Nov 09, 2021 10:42 am
by stam
dunbarx wrote:
Mon Nov 08, 2021 3:33 pm
I have heard odd things about LC and Big Sur. Anyone think it is not an issue?
The change to Big Sur did bring some bugs but these were squashed in subsequent release candidates (best version was 9.6.2 RC2 - subsequent versions have included acknowledged issues with graphic objects, but the Big Sur bugs were resolved in my use cases).

The upgrade to MacOS Monterey 12.0.1 was much better in that respect; Ive not experienced a single new bug so far in LC.

However, curiously, LiveCloudManager (LiveCloud's tool for viewing online databases) seems to hang on startup every single time i launch this. This does not affect LiveCloud in any other way (ie it works just fine within LC), but it's a monumental PITA if trying to work on a new project.
So that was an unanticipated casualty...

Re: RosettaCode

Posted: Tue Nov 09, 2021 1:52 pm
by simon.schvartzman
I have heard odd things about LC and Big Sur. Anyone think it is not an issue?
I have been using LC with Big Sur for several months now (on a MacBook Air M1) with no problem whatsoever, as a matter of fact I'm in doubt if I should upgrade to Monterrey right now of wait a bit to thing to settle a bit...