Introduction
On March 24th, 2015 @isaacg golfed his Pyth answer from 44 to 42 bytes. Since a crossed out 44 (44) looks a lot like a regular 44, @Optimizer made the following comment:
After that, on October 21st, 2015, @Doorknob♦ golfed his Ruby answer from 44 to 40 (and later 38) bytes and added the following part to his answer, with a link to that original comment of @Optimizer:
This was the start of an answer-chaining meme, where every crossed out 44 (and in some occasions 4 or 444) linked back to the previous one.
Then on April 8th, 2017 (I'm not sure if this was the first answer to do so, but it's the earliest one I could find), @JonathanAllan golfed his Python answer from 44 to 39. He however used <s> 44 </s>
so the 44 would look like this: 44 , and added the following to his answer:
Crossed out 44 is no longer 44 :)
And that was basically the (beginning of the) end of the meme.
Challenge
As for this challenge: Given a list of positive integers and a date, output the list comma-and-space separated where every number except for the last one is placed between <s>...</s>
tags.
In addition, if any of the crossed out numbers is in the sequence [4, 44, 444, 4444, ...]
(A00278 on oeis.org):
- If the date is before April 8th, 2017: Also output the exact (all lowercase and with semicolon emoticon) text
crossed out N is still regular N ;(
(N
being the crossed out number from the sequence) on a second line. - If the date is April 8th, 2017 or later: The crossed out number
N
from the sequence should have the leading and trailing
added. No need for any additional lines of output.
Examples:
Input: list = [50, 48, 44, 41]
, date = January 1st, 2017
Output:
<s>50</s>, <s>48</s>, <s>44</s>, 41
crossed out 44 is still regular 44 ;(
Input: list = [500, 475, 444, 301, 248]
, date = June 2nd, 2018
Output:
<s>500</s>, <s>475</s>, <s> 444 </s>, <s>301</s>, 248
Challenge rules:
- You can assume the input-list is a sorted list from largest to smallest, only containing positive integers. In reality a byte-count can also go up due to bug-fixes, but for the sake of this challenge we pretend it only goes down.
- You can assume only a single number from the sequence
[4, 44, 444, 4444, ...]
is present in the input-list (if any). - The output format is either printed to STDOUT, or returned as a string (or character array/list/2D-array if that's preferable). A trailing newline is of course optional.
- The output format is strict.
<s>...</s>
is mandatory; ...
is mandatory;", "
(comma and space) is mandatory; and\ncrossed out ... is still regular ... ;(
exactly is mandatory (on a separated line). - You may take the input-date as date-objects; timestamps; loose integers for year, month, and day; a single number in the format
yyyyMMdd
; integer days since December 31st, 1899 (which would be42832
for April 8th, 2017); or any other reasonable input-format. The date if-statement isn't the major part of this challenge. - The input integer-list can also be a list of strings if you want.
- You don't have to add the
<sup>...</sup>
tags to thecrossed out ... is still regular ... ;(
line as is usually done with the actual meme answers. - You can assume the input-list will never contain byte-counts outside the
[1, 50000]
range (so you'll only have these five{4, 44, 444, 4444, 44444}
to worry about).
General rules:
- This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language. - Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
- Default Loopholes are forbidden.
- If possible, please add a link with a test for your code.
- Also, adding an explanation for your answer is highly recommended.
Test cases:
Input: [50, 48, 44, 41] and January 1st, 2017
Output:
<s>50</s>, <s>48</s>, <s>44</s>, 41
crossed out 44 is still regular 44 ;(
Input: [500, 475, 444, 301, 248] and June 2nd, 2018
Output:
<s>500</s>, <s>475</s>, <s> 444 </s>, <s>301</s>, 248
Input: [8, 6, 4] and December 5th, 2017
Output:
<s>8</s>, <s>6</s>, 4
Input: [8, 6, 4, 3, 2] and September 15th, 2015
Output:
<s>8</s>, <s>6</s>, <s>4</s>, <s>3</s>, 2
crossed out 4 is still regular 4 ;(
Input: [119, 99, 84, 82, 74, 60, 51, 44, 36, 34] and February 29th, 2016
Output:
<s>119</s>, <s>99</s>, <s>84</s>, <s>82</s>, <s>74</s>, <s>60</s>, <s>51</s>, <s>44</s>, <s>36</s>, 34
crossed out 44 is still regular 44 ;(
Input: [404, 123, 44] and March 4th, 2016
Output:
<s>404</s>, <s>123</s>, 44
Input: [4, 3] and April 8th, 2017
Output:
<s> 4 </s>, 3
Input: [44] and October 22nd, 2017
Output:
44
Input: [50000, 44444, 1500] and August 1st, 2018
Output:
<s>50000</s>, <s> 44444 </s>, 1500
Input: 50, 38, 23 and September 8th, 2001
Output:
<s>50</s>, <s>38</s>, 23
1889-12-31
, can we also take days since2017-04-08
? \$\endgroup\$