13
3
This answer-chaining challenge is officially over, resulting in the win of Wheat Wizard, with a total of 7 answers. Any other answer is welcome, but it won't influence the accepted answer for this challenge, nor the winner.
Task:
Print all the positive divisors of a number x
taken as input.
Input:
A single number x
which is the number (in base 10) whose positive divisors should be computed.
Output:
All the positive divisors of x
. Any format is allowed, including \n
,,
,;
and whitespace as separators, as long as it's understandable. The output can be an array of Integers or Strings, too (e.g: [1, 2, 3, 5, 30]
). You may output the divisors to stdout, console or the equivalent in your language or they can be returned from a function.
Rules
- A user may not answer twice in a row
- Your answer may remove, add or replace at most 15 characters from the previous answer (whitespace does not count), besides for Answer 2 which can "transform" up to 20 characters to get things started
- You are not allowed to post an answer in a programming language that already has an answer, the exception being a completely different version of that language (e.g: If I post an answer in
Python 2.7
, you can submit one inPython 3
, but not inPython 2.6
) - Standard loopholes are not allowed
- You are not allowed to use built-ins for getting divisors, for the sake of this challenge
- You must include the answer's number and the language name in the question's title and the number of characters changed from the previous answer
Scoring
The user with the most submissions once the things settle out wins. In case of a tie, the user with the highest score on one of their answer wins. If there is a tie at the score as well, then the user with the oldest submission(oldest highest-scored answer) will be declared the winner.
Note: "settle out" <=> 7 3 days have passed since the last answer was submitted
Examples:
Input, Output:
14 => [1, 2, 7, 14]
25 => [1, 5, 25]
65 => [1, 5, 13, 65]
114 => [1, 2, 3, 6, 19, 38, 57, 114]
Or any other equivalent output satisfying the mentioned conditions.
Final Note: This question is better if you sort the answers by the oldest. I'll post the first answer in Python 2.7, so you should post the second answer depending on that one. Good luck and have fun!
Leaderboard:
This list may be outdated, fell free to edit it:
1) Wheat Wizard [Current Leader ]: 7 answers - Python 1.6, 05AB1E, Actually, Del|m|t, WSF, Brain-Flak, Lenguage
2) Riley: 3 answers - Seriously, CJam, 2sable
3) Jonathan Allan: 2 answers - Python 3, Jelly
3) ETHproductions: 2 answers - Japt, Pyth
3) Mistah Figgins: 2 answers - Befunge-98, Brain-Flak Classic
6) Riker: 1 answer - MATL
6) dzaima: 1 answer - SOGL 0.8.2
6) LegionMammal978: 1 answer - Whitespace
6) Nick Clifford: 1 answer - Ohm
6) Lynn: 1 answer - GolfScript
6) MickyT: 1 answer - Cubix
Distance calculator
You can use this snippet to calculate the distance between two entries:
function L(s,t){if(s===t)return 0;var S=s.length,T=t.length;if(S*T===0)return S+T;for(var i=0,v0=[],v1=[];i<=T;i++)v0[i]=i;for(i=0;i<S;i++){v1[0]=i+1;for(var j=0;j<T;j++)v1[j+1]=Math.min(v1[j]+1,v0[j+1]+1,v0[j]+(s[i]!=t[j]));for(j=0;j<=T;j++)v0[j]=v1[j]}return v1[T]}
<textarea id=A rows=10></textarea><textarea id=B rows=10></textarea><br>
Distance: <span id=O>0</span> <button onclick="O.innerHTML=L(A.value.replace(/\s/g,''),B.value.replace(/\s/g,''))">Run</button>
15 will work, 10 is standard though. I'd say keep it at 15 though, because this is harder than most. – Rɪᴋᴇʀ – 2017-03-09T19:52:49.333
2I hope you don't mind, but I added a distance calculator snippet to the bottom of the post :-) – ETHproductions – 2017-03-09T20:37:04.780
How can I possibly mind for improving the post? Thanks @ETHproductions – Mr. Xcoder – 2017-03-09T21:29:15.653
Would a function that finds most of the devisors but not all of them be considered a built in? – Post Rock Garf Hunter – 2017-03-10T00:33:18.420
@WheatWizard No, you are not allowed to use any kind of divisor built-in, it simplyfies your job but makes it very hard for others in programming languages that do not have useful built-ins – Mr. Xcoder – 2017-03-10T05:35:52.803
2That collaborative work to go toward brainfuck is beautiful :) – Walfrat – 2017-03-10T12:59:09.577
6IMPORTANT: Please edit the leaderboard when you make a submission, so it's easier to maintain.. – Mr. Xcoder – 2017-03-10T16:10:34.657
2It is awesome to see people bring the answers from Python to Brain-Flak, with a great collaborative work, from a widely spread language to one of the most obscure programming language ever created. Thanks to all who made it happen! Now I'm really interested to see what happens with this challenge, since DjMcMayhem has put a bounty on it. – Mr. Xcoder – 2017-03-15T05:52:23.893
BTW, there has to be bounties for helpers too. Probably 50 or 100? – Matthew Roh – 2017-03-15T13:15:53.637
Does the challenge being over mean that you still update the scoreboard, or that you can answer twice in a row? – MildlyMilquetoast – 2017-03-25T18:14:53.333
I don't update the leaderboard. It is officially closed. However, you can upload 2 answers in a row now, but they won't count to the leaderboard – Mr. Xcoder – 2017-03-25T18:16:26.033