⚠️ Warning: This is a draft ⚠️

This means it might contain formatting issues, incorrect code, conceptual problems, or other severe issues.

If you want to help to improve and eventually enable this page, please fork RosettaGit's repository and open a merge request on GitHub.

== Wrong example of even luckies? ==

'''take a list of all the positive even integers''' : 2, 4, 6, 8, 10, ... '''remove every 2nd number : 2, 6, 10, ... '''take the 2nd number (which is 4 )''' : Not 6?

(Also, why was this talk page deleted?) --[[User:Ledrug|Ledrug]] ([[User talk:Ledrug|talk]]) 09:09, 9 March 2014 (UTC)

:The sequence itself is correct, according OEIS, so the problem is in the description of the task. I believe the 2nd line in the second section is a copy/paste difficulty stemming from how the first sequence is defined. If instead of talking about deleting every other one, I suspect both sequences should be leave out the 2nd "skip every other one", and revise the first rule to be in terms of the odd numbers, the second sequence in terms of the even numbers. So we'd simply have:

''Lucky numbers'' are positive integers that are formed by:

:* take a list of all the positive odd integers :* take the 2nd number (which is ''' 3 ''') :* remove every 3rd number :* take the 3rd number (which is ''' 7 ''') :* remove every 7th number :* take the 4th number (which is ''' 9 ''') :* remove every 9th number :* take the 5th number (which is ''' 13 ''') :* remove every 13th number :* take the 6th number ···

'''definition of even lucky numbers'''

''Even lucky numbers'' are positive even integers that are formed by: :* take a list of all the positive even integers :* take the 2nd number (which is ''' 4 ''') :* remove every 4th number :* take the 3rd number (which is ''' 6 ''') :* remove every 6th number :* take the 4th number (which is ''' 10 ''') :* remove every 10th number :* take the 5th number (which is ''' 12 ''') :* remove every 12th number :* take the 6th number ···

:Parallelizing these descriptions shows how they are essentially the same algorithm (as shown by the parameterization of the algorithm in the Perl 6 solution). --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 01:56, 10 March 2014 (UTC)

:'''Or there is this explanation''', (very similar):

Note that in the following explanation list indices are assumed to start at one.

''Lucky numbers'' are positive integers that are formed by:

:* Form a list of all the positive odd integers :* Return the the 1st number from the list (which is ''' 1 ''') :* (Loop begins here) :* Note then return the 2nd number from the list (which is ''' 3 ''') :* Discard every 3rd, (as noted), number from the list to form the new list. :* (Expanding the loop a few more times...) :* Note then return the 3rd number from the list (which is ''' 7 ''') :* Discard every 7th, (as noted), number from the list to form the new list. :* (In short ...) :* Take the 4th. which is ''' 9 '''. Remove every 9th. :* Take the 5th. which is ''' 13 '''. Remove every 13th. :* ... :* Take the nth. which is ''' m '''. Remove every mth. increment n :* ...

'''Definition of even lucky numbers'''

This follows the same rules as the definition of lucky numbers above ''except for the very first step'' which becomes: :* Form a list of all the positive even integers

The change in initial condition of the list generates a new sequence starting 2, 4, 6, 10, ... as the same algorithmic steps are followed.

== What does "Mixed case should be supported" mean? ==

This phrase can be read in diametrically opposite ways. I took it to mean that it doesn't matter what case you type the argument, which means the prior rule about spelling would only care if you had the wrong letters, not the wrong case. By this interpretation the Perl 6 entry is not incorrect in its argument handling, and the example is merely demonstrating case insensitivity. If this is not the intended meaning of "mixed case", it needs to be clarified in terms of case sensitivity vs insensitivity. Perhaps my intepretation is colored by my absolute loathing of "camel case" words, which I think have no place in a task such as this, if indeed they are being considered mandatory. It's quite challenging enough to meet the numeric challenges of this task without all the extra API folderol, in my estimation. --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 01:09, 10 March 2014 (UTC)

:(Also, if the quibble is that Perl 6 entry isn't following the first three rules, it is. It is, in fact, testing for those conditions with the signature matching. If the intent is to mandate some kind of particular error message in response to those errors, it should be made clearer just how anally the original implementation is to be copied.) --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 01:24, 10 March 2014 (UTC) :(Or if the requirement is for a placeholder comma, it's certainly not necessary for the Perl 6 solution, though I could certainly make it throw one away easily enough. The point of Rosettacode is to show idiomatic usages, not force every language to show how it supports the limitations of other languages...) --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 01:42, 10 March 2014 (UTC)

:: Support of "mixed case" means to support the alphabetic options in any case, lower, upper, or mixed case (when the option was entered as the command line). Another phrase would be case insensitivity of a keyword (or option). The API requirement is meant to deal with writing a simple program that handles processing of lucky or even lucky numbers (either specific numbers, a range of numbers, or all numbers within a range) without changing/rewriting a program (either statements or values). This should not be seen as a limitation of any one language, but to support a user's invocation of a program to solve a general request (from the command line (versus via a program request). This is one method of supporting a general usage via the command line (CL) as opposed to writing a program that deals with just a fixed set of numbers to be generated. As for the comma placeholder, the comma is being used to indicate an omitted argument (or options), and is one common method to indicate such. It was not meant to be used just because of any language limitation, but just a method to indicate an omitted argument. The command line interface is one of the more common interfaces, and a free form format is the one that I choose to be used, it shouldn't be seen as particularly difficult or pedantic. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 07:09, 10 March 2014 (UTC)

:Protip: Please be more specific when you mark something incorrect, if you don't want to read all this verbiage of me wondering what you meant. :-) --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 02:36, 10 March 2014 (UTC)

::The quibble was that yesterday I thought itwas wrong; today I can find nothing wrong with your perl entry. I screwed up. (Again). I am going to have to come up with a new scheme for more thoroughly checking before marking thingsas incorrect. I might remember the track record of contributors and adjust my level of restraint based on that in the future for example. My apologies. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 06:53, 10 March 2014 (UTC)