40
2
The Challenge
Output a list of years that starts with the current year and ends 120 years ago. The birth year of every living human would be included in this list.
Details
The list should be in descending order.
Every built-in function to manipulate arrays and/or lists is allowed.
Shortest code in bytes wins.
When run this year the output would be
2016, 2015, ..., 1897, 1896
When run next year the output would be
2017, 2016, ..., 1898, 1897
Etc.
Update
- Some have asked about the format of the list. As most have guessed, it doesn't matter. Insert any separator between the numbers. Intuitively most inserted a comma or space or both, newline or output an array.
- Quasi superhumans like Jeanne Calment are an exception to the rule stated in my question.
2Please help me understand how to improve my question. It's my first code golf question. – Christiaan Westerbeek – 2016-08-11T11:30:13.477
7
I recommend the sandbox for getting feedback before posting a challenge (not just for your first challenge - most of us use it for every challenge).
– trichoplax – 2016-08-11T11:31:36.660Thanks. I didn't know the sandbox existed. Not sure though if I know now should delete my question first. Seems a legit code golf question, but I'll go to the sandbox first. – Christiaan Westerbeek – 2016-08-11T11:33:36.650
3I don't see anything wrong with this challenge. One thing that might be worth specifying is whether the output should always start with 2016, or with the year in which it is run (will it start with 2017 if run next year?). This will affect whether it is a fixed output challenge, or needs to access the current date. – trichoplax – 2016-08-11T11:33:45.810
If you get lots of downvotes, it probably means something is wrong. If you just get one downvote, it doesn't necessarily mean anything. It's worth asking just in case, but sometimes a challenge gets a downvote just at random. – trichoplax – 2016-08-11T11:36:24.573
3I think you should probably either specify a separator to use between years, or explicitly say we can use any separator. – Business Cat – 2016-08-11T14:07:06.710
19Jeanne Louise Calment lived 122 years. – Zenadix – 2016-08-11T15:32:52.077
10Lad, that was way too early of an accept. – Addison Crump – 2016-08-11T17:30:12.610
Does the output format matter? – Tom Carpenter – 2016-08-11T19:10:51.790
And you have an off-by-one besides. You can have a 119 year old born in 1895. – Loren Pechtel – 2016-08-11T23:30:38.393
6Is the challenge: "Print all the numbers from
y
- 120 toy
" or "print all the birth years of living people"? Because if someone born in 1896 is alive today, that doesn't mean that there are also still people from 1898 around. – CompuChip – 2016-08-14T09:58:09.6871Also, if Jeanne Louise Calment was the oldest recorded person ever, I think it's safe to say that 123 years is the upper limit. Why not go back 123 years? – Mr Lister – 2016-08-14T18:32:31.510