Talk:Range extraction: Difference between revisions

m
fixed typo.
m (fixed typo.)
 
(12 intermediate revisions by 2 users not shown)
Line 1:
== Might I suggest ...==
Might I suggest breaking the format description out to a separate page and transcluding it both here and in [[Range expansion]]? --[[User:Short Circuit|Michael Mol]] 00:17, 16 July 2010 (UTC)
 
Line 44 ⟶ 45:
 
Whether these functions are inverses of each other or not I think it would be nice to use the same example set of numbers for both tasks (the one from Range expansion task: -6,-3--1,3-5,7-11,14,15,17-20 would probably be most rigorous).
 
:::::: Except that some programs fail when the first integer is part of a range  (2 were flagged). -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 19:38, 18 April 2013 (UTC)
 
: Hi Tikkanz, It is enough that the range created/expanded is of the specified format, including:
:* No extra spaces
:* Only commas, dashes and numbers
:* etc ...
:Examples should standardize on the range format of the task description (There are some that add spaces and colons for example, that I have flagged incomplete).
 
:Unfortunately I didn't think of a good example to start off as I did not complete both tasks before creating the task pages, hence the different examples. I think it might be too late now to change? --[[User:Paddy3118|Paddy3118]] 07:53, 9 August 2010 (UTC)
 
==Comment in Ada solution on notation==
:''"For real-life applications it is better to use the notation -9..-4"''
True. if I were doing this for real then I would have liked to use a different range indication character, but, as in so many things, I modified/simplified an [http://www.ccs.miami.edu/hpc/lsf/7.0.6/admin/jobarrays.html#wp1004400 existing format that used dashes], to allow negative numbers - hence the compromise. (On seeing how easy it was to parse I left it in).
 
==TUSCRIPT example==
It would be good to both keep the current TUSCRIPT example - noting where it fails to follow the task description; as well as create a fully compliant version. It was pleasantly surprising to see that the language had a built-in routine that could so nearly produce the right answer! --[[User:Paddy3118|Paddy3118]] 21:31, 28 January 2011 (UTC)
 
==prime number musing==
 
[Under the category of using a hammer to swat a fly.]
 
One could use   ''range extraction''   for composite numbers to show prime numbers (indicated by the ''gaps'').
 
For the first 100 composite numbers:
 
: 4 6 8-10 12 14-16 18 20-22 24-28 30 32-36 38-40 42 44-46 48-52 54-58 60 62-66 68-70 72 74-78 80-82 84-88 90-96 98-100
 
Of course, primes   '''2'''   and   '''3'''   would be a special case. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 19:33, 18 April 2013 (UTC)
 
:With the requisite commas added of course :-)<br>--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:56, 19 April 2013 (UTC)
 
I was thinking that the commas would make the gaps (indicating primes) less visible:
 
: 4,6,8-10,12,14-16,18,20-22,24-28,30,32-36,38-40,42,44-46,48-52,54-58,60,62-66,68-70,72,74-78,80-82,84-88,90-96,98-100
 
-- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:08, 19 April 2013 (UTC)
 
::Sorry Gerard I didn't mean for you to go and make the change, I was jokingly making a reference to the rigidity of the spec for the format. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:45, 19 April 2013 (UTC)