crossed out 44 is still regular 44 ;(
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
14
down vote
favorite
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:
striked out 44 is still normal 44 :(
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:
crossed out 44 is still regular 44 ;(
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; andncrossed 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 five4, 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
code-golf string number date
 |Â
show 6 more comments
up vote
14
down vote
favorite
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:
striked out 44 is still normal 44 :(
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:
crossed out 44 is still regular 44 ;(
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; andncrossed 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 five4, 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
code-golf string number date
Your last test case is missing its date?
â Neil
Aug 8 at 8:47
@Neil Ah oops.. Fixed. Date doesn't really matter for that one, but added one regardless. Thanks for noticing.
â Kevin Cruijssen
Aug 8 at 8:49
1
I can confirm that I had not noticed anyone use the non-breaking space for this specific purpose and that was why I wrote the "no longer" text.
â Jonathan Allan
Aug 8 at 9:16
(I can also confirm that I had used it prior to using it with 44 - I believe that is when I first used them)
â Jonathan Allan
Aug 8 at 9:35
As we can take input as days since1889-12-31
, can we also take days since2017-04-08
?
â TFeld
Aug 8 at 11:49
 |Â
show 6 more comments
up vote
14
down vote
favorite
up vote
14
down vote
favorite
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:
striked out 44 is still normal 44 :(
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:
crossed out 44 is still regular 44 ;(
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; andncrossed 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 five4, 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
code-golf string number date
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:
striked out 44 is still normal 44 :(
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:
crossed out 44 is still regular 44 ;(
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; andncrossed 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 five4, 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
code-golf string number date
code-golf string number date
edited Aug 10 at 6:47
asked Aug 8 at 8:41
![](https://i.stack.imgur.com/MefSP.jpg?s=32&g=1)
![](https://i.stack.imgur.com/MefSP.jpg?s=32&g=1)
Kevin Cruijssen
30.8k553167
30.8k553167
Your last test case is missing its date?
â Neil
Aug 8 at 8:47
@Neil Ah oops.. Fixed. Date doesn't really matter for that one, but added one regardless. Thanks for noticing.
â Kevin Cruijssen
Aug 8 at 8:49
1
I can confirm that I had not noticed anyone use the non-breaking space for this specific purpose and that was why I wrote the "no longer" text.
â Jonathan Allan
Aug 8 at 9:16
(I can also confirm that I had used it prior to using it with 44 - I believe that is when I first used them)
â Jonathan Allan
Aug 8 at 9:35
As we can take input as days since1889-12-31
, can we also take days since2017-04-08
?
â TFeld
Aug 8 at 11:49
 |Â
show 6 more comments
Your last test case is missing its date?
â Neil
Aug 8 at 8:47
@Neil Ah oops.. Fixed. Date doesn't really matter for that one, but added one regardless. Thanks for noticing.
â Kevin Cruijssen
Aug 8 at 8:49
1
I can confirm that I had not noticed anyone use the non-breaking space for this specific purpose and that was why I wrote the "no longer" text.
â Jonathan Allan
Aug 8 at 9:16
(I can also confirm that I had used it prior to using it with 44 - I believe that is when I first used them)
â Jonathan Allan
Aug 8 at 9:35
As we can take input as days since1889-12-31
, can we also take days since2017-04-08
?
â TFeld
Aug 8 at 11:49
Your last test case is missing its date?
â Neil
Aug 8 at 8:47
Your last test case is missing its date?
â Neil
Aug 8 at 8:47
@Neil Ah oops.. Fixed. Date doesn't really matter for that one, but added one regardless. Thanks for noticing.
â Kevin Cruijssen
Aug 8 at 8:49
@Neil Ah oops.. Fixed. Date doesn't really matter for that one, but added one regardless. Thanks for noticing.
â Kevin Cruijssen
Aug 8 at 8:49
1
1
I can confirm that I had not noticed anyone use the non-breaking space for this specific purpose and that was why I wrote the "no longer" text.
â Jonathan Allan
Aug 8 at 9:16
I can confirm that I had not noticed anyone use the non-breaking space for this specific purpose and that was why I wrote the "no longer" text.
â Jonathan Allan
Aug 8 at 9:16
(I can also confirm that I had used it prior to using it with 44 - I believe that is when I first used them)
â Jonathan Allan
Aug 8 at 9:35
(I can also confirm that I had used it prior to using it with 44 - I believe that is when I first used them)
â Jonathan Allan
Aug 8 at 9:35
As we can take input as days since
1889-12-31
, can we also take days since 2017-04-08
?â TFeld
Aug 8 at 11:49
As we can take input as days since
1889-12-31
, can we also take days since 2017-04-08
?â TFeld
Aug 8 at 11:49
 |Â
show 6 more comments
8 Answers
8
active
oldest
votes
up vote
2
down vote
accepted
Jelly, Â 444Â , 94, 93 bytes
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾,
â´>â½Aâ¬
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,ÃÂ
A full program. The inputs are a list of strings and a date taken as integer days since January the first 1970 (making 17264 April the eighth 2017)
Try it online!
How?
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾, - Link 1: L = list of characters ("4...4") OR integer (0),
- R = list of lists of characters (the strings provided to the program)
$ - last 2 links as a monad:
ÃÂ - call next Link (2) as a monad
- ...gets: is date input to program greater than 2017-04-07?
ç - AND (if so gets the value of L, else 0), say X
æ@ - sparse application (with swa@pped @rguments)...
á¹ - ...with right argument = popped R (without it's rightmost entry)
ÃÂ - ...to: last 3 links as a dyad
i - first index of X in popped R (0 if no found, so 0->0)
. - literal 0.5
o - OR (change any 0 to 0.5)
- ...i.e. index of "4...4" if L was one or 0.5, an invalid index
$⬠- ...do: for â¬ach... last 2 links as a monad:
ä - nilad followed by link(s) as a nilad:
â â - literal list of characters = " "
, - pair (with itself) = [" ", " "]
j - join (with the item) e.g.: " 444 " or [" ", 0, " "]
âÂÂ<s>âÂÂ</s>â - literal list of lists of characters = ["<s>", "</s>"]
j@⬠- for â¬ach... join (with swa@pped @rguments)
o - OR with R (vectorises, so adds the popped entry back onto the right-side)
â¾, - literal list of characters = ", "
j - join
â´>â½A⬠- Link 2: greater than 2017-04-07?
â´ - program's 4th argument (2nd input)
â½A⬠- literal 17263 (days(2017-04-07 - 1970-01-01))
> - greater than?
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò - Link 3: L = list of characters ("4...4") OR integer (0)
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVû - compressed list of characters = "crossed out n is still regular n ;("
á»´ - split at newlines = ["crossed out ", " is still regular ", " ;("]
j - join with L
â· - literal newline character
á¹ - tack (add to the front)
ò - last 4 links as a monad:
ÃÂ - call last Link (2) as a monad
ì - NOT
Ạ- All (1 if L is "4...4", 0 if L is 0)
ç - AND
Ạ- repeat (i.e. get the list of characters to print or an empty list)
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,à- Main Link: list of strings, integer (days since 1970-01-01)
á¹ - pop (list of strings without it's rightmost entry)
ÃÂḠ- filter discard if:
Ḡ- filter discard any which are in...
âÂÂ4 - ...literal character '4'
Ḣ - head (yields 0 if list is now empty)
õ - new monadic chain, call that X
ó - program's 3rd argument (1st input) - call that Y)
ñ - call next Link (1) as a dyad (i.e. f1(X, Y))
ÃÂ - call last Link (3) as a monad (ie. f3(X))
, - pair
- implicit (smashing) print
1
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
1
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
add a comment |Â
up vote
3
down vote
Python 2, 208 204Â 203 201 197 bytes
Takes input as a list of strings, and an int of yyyymmDD
def f(l,d):
A=a=d>20170407;r=
for n in l[:-1]:x=set(n)=='4';S=' '*x*a;r+=['<s>'+S+n+S+'</s>'];A=x*n or A
print', '.join(r+l[-1:])+'ncrossed out %s is still regular %s ;('%(A,A)*(a*A<A)
Try it online!
add a comment |Â
up vote
3
down vote
Excel VBA, 217 bytes
VBE immediate window function that takes input array from range [A:A]
, and date from range [B1]
and outputs to the console.
c=[Count(A:A)]:d=[B1]>42832:For i=1To c-1:n=Cells(i,1):l=InStr(44444,n):s=IIf(d*l," ",""):v=IIf((d=0)*l,n,v):?"<s>"s;""&n;s"</s>, ";:Next:?""&Cells(i,1):?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
Ungolfed and Commented
c=[Count(A:A)] '' Get numer of elements
d=[B1]>42832 '' Check if date is after 7 Apr 2017,
For i=1To c-1 '' Iterate over index
n=Cells(i,1) '' Get array val at index
l=InStr(44444,n) '' Check if val is all 4s
s=IIf(d*l," ","") '' If after 7 Aug 2017, and All 4s, let `s` be " "
v=IIf((d=0)*l,n,v) '' If all 4s, and not after date, let v hold n, else hold v
?"<s>"s;""&n;s"</s>, "; '' Print striked vales, with " ", if applicable
Next '' Loop
?""&Cells(i,1) '' Print last value in array
'' (below) Print meme, if needed
?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
-2 bytes for changing date format to YYYYMMDD
-1 byte for comparing to 42832
(int value for 07 Apr 2017
), Thanks @Neil
-2 bytes for removing 1,
from the InStr
statement, Thanks @SeaDoggie01
I guessFor i=1To~-c
instead ofFor i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not isNot
instead of~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)
â Kevin Cruijssen
Aug 8 at 13:05
@KevinCruijssen Yeah, bitwise not isNot
, so no~
:(
â Taylor Scott
Aug 8 at 13:07
1
I think you can save more bytes by changing the date format back to date and comparing against42832
(the integer value of 2017-04-07).
â Neil
Aug 8 at 15:24
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
add a comment |Â
up vote
2
down vote
Retina 0.8.2, 130 bytes
$
;42833
O`;.5
b(4+),(?=.*;42833;)
&$1&,
&
.12$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Uses Excel date stamps (days since 1899-12-31 but including 1900-02-49). 141 bytes for a version that takes ISO dates:
$
;2017-04-08
O`;.10
b(4+),(?=.*;2017-04-08;)
&$1&,
&
.22$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Explanation:
$
;2017-04-08
Append the cut-off date to the input.
O`;.10
Sort the dates. If the given date is on or after the cut-off date then the first date will be the cut-off date.
b(4+),(?=.*;2017-04-08;)
&$1&,
&
In that case, wrap the 4+
in
(using two stages as it saves a byte).
.22$
Delete the dates as they have done their job.
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
If there's an unspaced 4+
, then append the meme.
(.+?),
<s>$1</s>,
Strike out all of the obsolete byte counts.
You can save 5 bytes by taking the date-format without-
.
â Kevin Cruijssen
Aug 8 at 9:11
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
Hmm.. You know what, that's also fine by me. How the if-statement for the dateApril 8th, 2017
is done I don't really care. It's not the major part of this challenge.
â Kevin Cruijssen
Aug 8 at 11:12
That would be42832
for April 8th, 2017 I assume?
â Kevin Cruijssen
Aug 8 at 11:18
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
 |Â
show 3 more comments
up vote
1
down vote
Ruby, 208 184 180 bytes
TIO-test
Thanks for @KevinCruijssen for saving 2 bytes!
->n,d*h,t=n;i=20170408>d;f=?n;h.map==[4];f=o&&i ?f+"crossed out #u is still regular #u ;(":f;o&&!i ?"<s> #u </s>":"<s>#u</s>"*", "+", #t"+f
It's a lambda function that takes a list of numbers and an integer as a date in the format of YYYYmmdd
.
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)
â Kevin Cruijssen
Aug 9 at 12:41
add a comment |Â
up vote
1
down vote
JavaScript, 194 bytes
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
add a comment |Â
up vote
1
down vote
Haskell, 227 bytes
i=1>0;i('4':s)=i s;i(_:_)=0>1
f l d=m l++c where a=head$filter i l;t d|d<42832=("","ncrossed out "++a++" is still regular "++a++" ;(")|1>0=(" ","");(b,c)=t d;w n|i n=b++n++b|1>0=n;m[n]=n;m(x:s)="<s>"++w x++"</s>, "++m s
Try it online!
Run f
with list l
and date d
. 42832 is the changing date.
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
 |Â
show 1 more comment
up vote
1
down vote
JavaScript (Node.js), 173 bytes
a=>d=>a.map(x=>--i<1?x:`<s>$(b=/^4+$/.exec(x)?(c=x,d)<14915808e5?n=:" ":"")+x+b</s>`,n="",c=0,i=a.length).join`, `+(n&&`
crossed out $c is still regular $c ;(`)
Try it online!
Using curry syntax f(array)(js_timestamp)
add a comment |Â
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Jelly, Â 444Â , 94, 93 bytes
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾,
â´>â½Aâ¬
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,ÃÂ
A full program. The inputs are a list of strings and a date taken as integer days since January the first 1970 (making 17264 April the eighth 2017)
Try it online!
How?
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾, - Link 1: L = list of characters ("4...4") OR integer (0),
- R = list of lists of characters (the strings provided to the program)
$ - last 2 links as a monad:
ÃÂ - call next Link (2) as a monad
- ...gets: is date input to program greater than 2017-04-07?
ç - AND (if so gets the value of L, else 0), say X
æ@ - sparse application (with swa@pped @rguments)...
á¹ - ...with right argument = popped R (without it's rightmost entry)
ÃÂ - ...to: last 3 links as a dyad
i - first index of X in popped R (0 if no found, so 0->0)
. - literal 0.5
o - OR (change any 0 to 0.5)
- ...i.e. index of "4...4" if L was one or 0.5, an invalid index
$⬠- ...do: for â¬ach... last 2 links as a monad:
ä - nilad followed by link(s) as a nilad:
â â - literal list of characters = " "
, - pair (with itself) = [" ", " "]
j - join (with the item) e.g.: " 444 " or [" ", 0, " "]
âÂÂ<s>âÂÂ</s>â - literal list of lists of characters = ["<s>", "</s>"]
j@⬠- for â¬ach... join (with swa@pped @rguments)
o - OR with R (vectorises, so adds the popped entry back onto the right-side)
â¾, - literal list of characters = ", "
j - join
â´>â½A⬠- Link 2: greater than 2017-04-07?
â´ - program's 4th argument (2nd input)
â½A⬠- literal 17263 (days(2017-04-07 - 1970-01-01))
> - greater than?
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò - Link 3: L = list of characters ("4...4") OR integer (0)
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVû - compressed list of characters = "crossed out n is still regular n ;("
á»´ - split at newlines = ["crossed out ", " is still regular ", " ;("]
j - join with L
â· - literal newline character
á¹ - tack (add to the front)
ò - last 4 links as a monad:
ÃÂ - call last Link (2) as a monad
ì - NOT
Ạ- All (1 if L is "4...4", 0 if L is 0)
ç - AND
Ạ- repeat (i.e. get the list of characters to print or an empty list)
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,à- Main Link: list of strings, integer (days since 1970-01-01)
á¹ - pop (list of strings without it's rightmost entry)
ÃÂḠ- filter discard if:
Ḡ- filter discard any which are in...
âÂÂ4 - ...literal character '4'
Ḣ - head (yields 0 if list is now empty)
õ - new monadic chain, call that X
ó - program's 3rd argument (1st input) - call that Y)
ñ - call next Link (1) as a dyad (i.e. f1(X, Y))
ÃÂ - call last Link (3) as a monad (ie. f3(X))
, - pair
- implicit (smashing) print
1
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
1
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
add a comment |Â
up vote
2
down vote
accepted
Jelly, Â 444Â , 94, 93 bytes
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾,
â´>â½Aâ¬
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,ÃÂ
A full program. The inputs are a list of strings and a date taken as integer days since January the first 1970 (making 17264 April the eighth 2017)
Try it online!
How?
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾, - Link 1: L = list of characters ("4...4") OR integer (0),
- R = list of lists of characters (the strings provided to the program)
$ - last 2 links as a monad:
ÃÂ - call next Link (2) as a monad
- ...gets: is date input to program greater than 2017-04-07?
ç - AND (if so gets the value of L, else 0), say X
æ@ - sparse application (with swa@pped @rguments)...
á¹ - ...with right argument = popped R (without it's rightmost entry)
ÃÂ - ...to: last 3 links as a dyad
i - first index of X in popped R (0 if no found, so 0->0)
. - literal 0.5
o - OR (change any 0 to 0.5)
- ...i.e. index of "4...4" if L was one or 0.5, an invalid index
$⬠- ...do: for â¬ach... last 2 links as a monad:
ä - nilad followed by link(s) as a nilad:
â â - literal list of characters = " "
, - pair (with itself) = [" ", " "]
j - join (with the item) e.g.: " 444 " or [" ", 0, " "]
âÂÂ<s>âÂÂ</s>â - literal list of lists of characters = ["<s>", "</s>"]
j@⬠- for â¬ach... join (with swa@pped @rguments)
o - OR with R (vectorises, so adds the popped entry back onto the right-side)
â¾, - literal list of characters = ", "
j - join
â´>â½A⬠- Link 2: greater than 2017-04-07?
â´ - program's 4th argument (2nd input)
â½A⬠- literal 17263 (days(2017-04-07 - 1970-01-01))
> - greater than?
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò - Link 3: L = list of characters ("4...4") OR integer (0)
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVû - compressed list of characters = "crossed out n is still regular n ;("
á»´ - split at newlines = ["crossed out ", " is still regular ", " ;("]
j - join with L
â· - literal newline character
á¹ - tack (add to the front)
ò - last 4 links as a monad:
ÃÂ - call last Link (2) as a monad
ì - NOT
Ạ- All (1 if L is "4...4", 0 if L is 0)
ç - AND
Ạ- repeat (i.e. get the list of characters to print or an empty list)
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,à- Main Link: list of strings, integer (days since 1970-01-01)
á¹ - pop (list of strings without it's rightmost entry)
ÃÂḠ- filter discard if:
Ḡ- filter discard any which are in...
âÂÂ4 - ...literal character '4'
Ḣ - head (yields 0 if list is now empty)
õ - new monadic chain, call that X
ó - program's 3rd argument (1st input) - call that Y)
ñ - call next Link (1) as a dyad (i.e. f1(X, Y))
ÃÂ - call last Link (3) as a monad (ie. f3(X))
, - pair
- implicit (smashing) print
1
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
1
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Jelly, Â 444Â , 94, 93 bytes
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾,
â´>â½Aâ¬
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,ÃÂ
A full program. The inputs are a list of strings and a date taken as integer days since January the first 1970 (making 17264 April the eighth 2017)
Try it online!
How?
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾, - Link 1: L = list of characters ("4...4") OR integer (0),
- R = list of lists of characters (the strings provided to the program)
$ - last 2 links as a monad:
ÃÂ - call next Link (2) as a monad
- ...gets: is date input to program greater than 2017-04-07?
ç - AND (if so gets the value of L, else 0), say X
æ@ - sparse application (with swa@pped @rguments)...
á¹ - ...with right argument = popped R (without it's rightmost entry)
ÃÂ - ...to: last 3 links as a dyad
i - first index of X in popped R (0 if no found, so 0->0)
. - literal 0.5
o - OR (change any 0 to 0.5)
- ...i.e. index of "4...4" if L was one or 0.5, an invalid index
$⬠- ...do: for â¬ach... last 2 links as a monad:
ä - nilad followed by link(s) as a nilad:
â â - literal list of characters = " "
, - pair (with itself) = [" ", " "]
j - join (with the item) e.g.: " 444 " or [" ", 0, " "]
âÂÂ<s>âÂÂ</s>â - literal list of lists of characters = ["<s>", "</s>"]
j@⬠- for â¬ach... join (with swa@pped @rguments)
o - OR with R (vectorises, so adds the popped entry back onto the right-side)
â¾, - literal list of characters = ", "
j - join
â´>â½A⬠- Link 2: greater than 2017-04-07?
â´ - program's 4th argument (2nd input)
â½A⬠- literal 17263 (days(2017-04-07 - 1970-01-01))
> - greater than?
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò - Link 3: L = list of characters ("4...4") OR integer (0)
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVû - compressed list of characters = "crossed out n is still regular n ;("
á»´ - split at newlines = ["crossed out ", " is still regular ", " ;("]
j - join with L
â· - literal newline character
á¹ - tack (add to the front)
ò - last 4 links as a monad:
ÃÂ - call last Link (2) as a monad
ì - NOT
Ạ- All (1 if L is "4...4", 0 if L is 0)
ç - AND
Ạ- repeat (i.e. get the list of characters to print or an empty list)
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,à- Main Link: list of strings, integer (days since 1970-01-01)
á¹ - pop (list of strings without it's rightmost entry)
ÃÂḠ- filter discard if:
Ḡ- filter discard any which are in...
âÂÂ4 - ...literal character '4'
Ḣ - head (yields 0 if list is now empty)
õ - new monadic chain, call that X
ó - program's 3rd argument (1st input) - call that Y)
ñ - call next Link (1) as a dyad (i.e. f1(X, Y))
ÃÂ - call last Link (3) as a monad (ie. f3(X))
, - pair
- implicit (smashing) print
Jelly, Â 444Â , 94, 93 bytes
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾,
â´>â½Aâ¬
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,ÃÂ
A full program. The inputs are a list of strings and a date taken as integer days since January the first 1970 (making 17264 April the eighth 2017)
Try it online!
How?
ÃÂç$â âÂÂ,äj$â¬io.ÃÂæ@á¹Âj@â‰ÂÂ<s>âÂÂ</s>âÂÂojâ¾, - Link 1: L = list of characters ("4...4") OR integer (0),
- R = list of lists of characters (the strings provided to the program)
$ - last 2 links as a monad:
ÃÂ - call next Link (2) as a monad
- ...gets: is date input to program greater than 2017-04-07?
ç - AND (if so gets the value of L, else 0), say X
æ@ - sparse application (with swa@pped @rguments)...
á¹ - ...with right argument = popped R (without it's rightmost entry)
ÃÂ - ...to: last 3 links as a dyad
i - first index of X in popped R (0 if no found, so 0->0)
. - literal 0.5
o - OR (change any 0 to 0.5)
- ...i.e. index of "4...4" if L was one or 0.5, an invalid index
$⬠- ...do: for â¬ach... last 2 links as a monad:
ä - nilad followed by link(s) as a nilad:
â â - literal list of characters = " "
, - pair (with itself) = [" ", " "]
j - join (with the item) e.g.: " 444 " or [" ", 0, " "]
âÂÂ<s>âÂÂ</s>â - literal list of lists of characters = ["<s>", "</s>"]
j@⬠- for â¬ach... join (with swa@pped @rguments)
o - OR with R (vectorises, so adds the popped entry back onto the right-side)
â¾, - literal list of characters = ", "
j - join
â´>â½A⬠- Link 2: greater than 2017-04-07?
â´ - program's 4th argument (2nd input)
â½A⬠- literal 17263 (days(2017-04-07 - 1970-01-01))
> - greater than?
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVÃȇȫjá¹ÂâÂᇼÂÃÂìçẠò - Link 3: L = list of characters ("4...4") OR integer (0)
âÂÂââ»$gáºÂẠâ·Ṭ]ḳá¹Âá¹ÂÃ
¼?=çá»ÂIÃÂVû - compressed list of characters = "crossed out n is still regular n ;("
á»´ - split at newlines = ["crossed out ", " is still regular ", " ;("]
j - join with L
â· - literal newline character
á¹ - tack (add to the front)
ò - last 4 links as a monad:
ÃÂ - call last Link (2) as a monad
ì - NOT
Ạ- All (1 if L is "4...4", 0 if L is 0)
ç - AND
Ạ- repeat (i.e. get the list of characters to print or an empty list)
á¹Âá¸ÂÃÂá¸ÂâÂÂ4Ḣõñó,à- Main Link: list of strings, integer (days since 1970-01-01)
á¹ - pop (list of strings without it's rightmost entry)
ÃÂḠ- filter discard if:
Ḡ- filter discard any which are in...
âÂÂ4 - ...literal character '4'
Ḣ - head (yields 0 if list is now empty)
õ - new monadic chain, call that X
ó - program's 3rd argument (1st input) - call that Y)
ñ - call next Link (1) as a dyad (i.e. f1(X, Y))
ÃÂ - call last Link (3) as a monad (ie. f3(X))
, - pair
- implicit (smashing) print
edited Aug 12 at 12:26
answered Aug 11 at 22:16
![](https://i.stack.imgur.com/fIyIX.jpg?s=32&g=1)
![](https://i.stack.imgur.com/fIyIX.jpg?s=32&g=1)
Jonathan Allan
48.6k534160
48.6k534160
1
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
1
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
add a comment |Â
1
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
1
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
1
1
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
You forgot to remove the input from another challenge in your TIO. ;) Nice answer regardless. Would you mind adding an explanation? And rofl at that 444-byte count. I don't believe it one bit that you started with that, unless you added comments. ;p
â Kevin Cruijssen
Aug 12 at 9:18
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
Opps, thanks. I'll add an explanation shortly.
â Jonathan Allan
Aug 12 at 10:16
1
1
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
444 version no comments, numbers rather than compressed strings
â Jonathan Allan
Aug 12 at 10:17
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
...ah the 444 version has a bug - its using days since 1969-12-31 not since 1970-01-01 as the golfed version does >_< (naive fix is still 444)
â Jonathan Allan
Aug 12 at 12:31
add a comment |Â
up vote
3
down vote
Python 2, 208 204Â 203 201 197 bytes
Takes input as a list of strings, and an int of yyyymmDD
def f(l,d):
A=a=d>20170407;r=
for n in l[:-1]:x=set(n)=='4';S=' '*x*a;r+=['<s>'+S+n+S+'</s>'];A=x*n or A
print', '.join(r+l[-1:])+'ncrossed out %s is still regular %s ;('%(A,A)*(a*A<A)
Try it online!
add a comment |Â
up vote
3
down vote
Python 2, 208 204Â 203 201 197 bytes
Takes input as a list of strings, and an int of yyyymmDD
def f(l,d):
A=a=d>20170407;r=
for n in l[:-1]:x=set(n)=='4';S=' '*x*a;r+=['<s>'+S+n+S+'</s>'];A=x*n or A
print', '.join(r+l[-1:])+'ncrossed out %s is still regular %s ;('%(A,A)*(a*A<A)
Try it online!
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Python 2, 208 204Â 203 201 197 bytes
Takes input as a list of strings, and an int of yyyymmDD
def f(l,d):
A=a=d>20170407;r=
for n in l[:-1]:x=set(n)=='4';S=' '*x*a;r+=['<s>'+S+n+S+'</s>'];A=x*n or A
print', '.join(r+l[-1:])+'ncrossed out %s is still regular %s ;('%(A,A)*(a*A<A)
Try it online!
Python 2, 208 204Â 203 201 197 bytes
Takes input as a list of strings, and an int of yyyymmDD
def f(l,d):
A=a=d>20170407;r=
for n in l[:-1]:x=set(n)=='4';S=' '*x*a;r+=['<s>'+S+n+S+'</s>'];A=x*n or A
print', '.join(r+l[-1:])+'ncrossed out %s is still regular %s ;('%(A,A)*(a*A<A)
Try it online!
edited Aug 8 at 13:06
answered Aug 8 at 11:11
![](https://lh4.googleusercontent.com/--5YsIJJFGW8/AAAAAAAAAAI/AAAAAAAAAFs/16m9PHD-o4k/photo.jpg?sz=32)
![](https://lh4.googleusercontent.com/--5YsIJJFGW8/AAAAAAAAAAI/AAAAAAAAAFs/16m9PHD-o4k/photo.jpg?sz=32)
TFeld
11.9k2833
11.9k2833
add a comment |Â
add a comment |Â
up vote
3
down vote
Excel VBA, 217 bytes
VBE immediate window function that takes input array from range [A:A]
, and date from range [B1]
and outputs to the console.
c=[Count(A:A)]:d=[B1]>42832:For i=1To c-1:n=Cells(i,1):l=InStr(44444,n):s=IIf(d*l," ",""):v=IIf((d=0)*l,n,v):?"<s>"s;""&n;s"</s>, ";:Next:?""&Cells(i,1):?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
Ungolfed and Commented
c=[Count(A:A)] '' Get numer of elements
d=[B1]>42832 '' Check if date is after 7 Apr 2017,
For i=1To c-1 '' Iterate over index
n=Cells(i,1) '' Get array val at index
l=InStr(44444,n) '' Check if val is all 4s
s=IIf(d*l," ","") '' If after 7 Aug 2017, and All 4s, let `s` be " "
v=IIf((d=0)*l,n,v) '' If all 4s, and not after date, let v hold n, else hold v
?"<s>"s;""&n;s"</s>, "; '' Print striked vales, with " ", if applicable
Next '' Loop
?""&Cells(i,1) '' Print last value in array
'' (below) Print meme, if needed
?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
-2 bytes for changing date format to YYYYMMDD
-1 byte for comparing to 42832
(int value for 07 Apr 2017
), Thanks @Neil
-2 bytes for removing 1,
from the InStr
statement, Thanks @SeaDoggie01
I guessFor i=1To~-c
instead ofFor i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not isNot
instead of~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)
â Kevin Cruijssen
Aug 8 at 13:05
@KevinCruijssen Yeah, bitwise not isNot
, so no~
:(
â Taylor Scott
Aug 8 at 13:07
1
I think you can save more bytes by changing the date format back to date and comparing against42832
(the integer value of 2017-04-07).
â Neil
Aug 8 at 15:24
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
add a comment |Â
up vote
3
down vote
Excel VBA, 217 bytes
VBE immediate window function that takes input array from range [A:A]
, and date from range [B1]
and outputs to the console.
c=[Count(A:A)]:d=[B1]>42832:For i=1To c-1:n=Cells(i,1):l=InStr(44444,n):s=IIf(d*l," ",""):v=IIf((d=0)*l,n,v):?"<s>"s;""&n;s"</s>, ";:Next:?""&Cells(i,1):?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
Ungolfed and Commented
c=[Count(A:A)] '' Get numer of elements
d=[B1]>42832 '' Check if date is after 7 Apr 2017,
For i=1To c-1 '' Iterate over index
n=Cells(i,1) '' Get array val at index
l=InStr(44444,n) '' Check if val is all 4s
s=IIf(d*l," ","") '' If after 7 Aug 2017, and All 4s, let `s` be " "
v=IIf((d=0)*l,n,v) '' If all 4s, and not after date, let v hold n, else hold v
?"<s>"s;""&n;s"</s>, "; '' Print striked vales, with " ", if applicable
Next '' Loop
?""&Cells(i,1) '' Print last value in array
'' (below) Print meme, if needed
?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
-2 bytes for changing date format to YYYYMMDD
-1 byte for comparing to 42832
(int value for 07 Apr 2017
), Thanks @Neil
-2 bytes for removing 1,
from the InStr
statement, Thanks @SeaDoggie01
I guessFor i=1To~-c
instead ofFor i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not isNot
instead of~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)
â Kevin Cruijssen
Aug 8 at 13:05
@KevinCruijssen Yeah, bitwise not isNot
, so no~
:(
â Taylor Scott
Aug 8 at 13:07
1
I think you can save more bytes by changing the date format back to date and comparing against42832
(the integer value of 2017-04-07).
â Neil
Aug 8 at 15:24
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Excel VBA, 217 bytes
VBE immediate window function that takes input array from range [A:A]
, and date from range [B1]
and outputs to the console.
c=[Count(A:A)]:d=[B1]>42832:For i=1To c-1:n=Cells(i,1):l=InStr(44444,n):s=IIf(d*l," ",""):v=IIf((d=0)*l,n,v):?"<s>"s;""&n;s"</s>, ";:Next:?""&Cells(i,1):?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
Ungolfed and Commented
c=[Count(A:A)] '' Get numer of elements
d=[B1]>42832 '' Check if date is after 7 Apr 2017,
For i=1To c-1 '' Iterate over index
n=Cells(i,1) '' Get array val at index
l=InStr(44444,n) '' Check if val is all 4s
s=IIf(d*l," ","") '' If after 7 Aug 2017, and All 4s, let `s` be " "
v=IIf((d=0)*l,n,v) '' If all 4s, and not after date, let v hold n, else hold v
?"<s>"s;""&n;s"</s>, "; '' Print striked vales, with " ", if applicable
Next '' Loop
?""&Cells(i,1) '' Print last value in array
'' (below) Print meme, if needed
?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
-2 bytes for changing date format to YYYYMMDD
-1 byte for comparing to 42832
(int value for 07 Apr 2017
), Thanks @Neil
-2 bytes for removing 1,
from the InStr
statement, Thanks @SeaDoggie01
Excel VBA, 217 bytes
VBE immediate window function that takes input array from range [A:A]
, and date from range [B1]
and outputs to the console.
c=[Count(A:A)]:d=[B1]>42832:For i=1To c-1:n=Cells(i,1):l=InStr(44444,n):s=IIf(d*l," ",""):v=IIf((d=0)*l,n,v):?"<s>"s;""&n;s"</s>, ";:Next:?""&Cells(i,1):?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
Ungolfed and Commented
c=[Count(A:A)] '' Get numer of elements
d=[B1]>42832 '' Check if date is after 7 Apr 2017,
For i=1To c-1 '' Iterate over index
n=Cells(i,1) '' Get array val at index
l=InStr(44444,n) '' Check if val is all 4s
s=IIf(d*l," ","") '' If after 7 Aug 2017, and All 4s, let `s` be " "
v=IIf((d=0)*l,n,v) '' If all 4s, and not after date, let v hold n, else hold v
?"<s>"s;""&n;s"</s>, "; '' Print striked vales, with " ", if applicable
Next '' Loop
?""&Cells(i,1) '' Print last value in array
'' (below) Print meme, if needed
?IIf(v,"crossed out "&v &" is still regular "&v &" ;(","");
-2 bytes for changing date format to YYYYMMDD
-1 byte for comparing to 42832
(int value for 07 Apr 2017
), Thanks @Neil
-2 bytes for removing 1,
from the InStr
statement, Thanks @SeaDoggie01
edited Sep 12 at 15:12
answered Aug 8 at 12:55
![](https://i.stack.imgur.com/JfvZO.png?s=32&g=1)
![](https://i.stack.imgur.com/JfvZO.png?s=32&g=1)
Taylor Scott
5,97711041
5,97711041
I guessFor i=1To~-c
instead ofFor i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not isNot
instead of~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)
â Kevin Cruijssen
Aug 8 at 13:05
@KevinCruijssen Yeah, bitwise not isNot
, so no~
:(
â Taylor Scott
Aug 8 at 13:07
1
I think you can save more bytes by changing the date format back to date and comparing against42832
(the integer value of 2017-04-07).
â Neil
Aug 8 at 15:24
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
add a comment |Â
I guessFor i=1To~-c
instead ofFor i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not isNot
instead of~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)
â Kevin Cruijssen
Aug 8 at 13:05
@KevinCruijssen Yeah, bitwise not isNot
, so no~
:(
â Taylor Scott
Aug 8 at 13:07
1
I think you can save more bytes by changing the date format back to date and comparing against42832
(the integer value of 2017-04-07).
â Neil
Aug 8 at 15:24
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
I guess
For i=1To~-c
instead of For i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not is Not
instead of ~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)â Kevin Cruijssen
Aug 8 at 13:05
I guess
For i=1To~-c
instead of For i=1To c-1
isn't possible in Excel VBA? If I recall correctly Bitwise not is Not
instead of ~
, or are both possible? (Note that I know next to nothing of Excel VBA, so I'm probably saying something stupid here. ;p)â Kevin Cruijssen
Aug 8 at 13:05
@KevinCruijssen Yeah, bitwise not is
Not
, so no ~
:(â Taylor Scott
Aug 8 at 13:07
@KevinCruijssen Yeah, bitwise not is
Not
, so no ~
:(â Taylor Scott
Aug 8 at 13:07
1
1
I think you can save more bytes by changing the date format back to date and comparing against
42832
(the integer value of 2017-04-07).â Neil
Aug 8 at 15:24
I think you can save more bytes by changing the date format back to date and comparing against
42832
(the integer value of 2017-04-07).â Neil
Aug 8 at 15:24
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
I think you can save 2 bytes by removing the "1," from the instr (it's optional)
â seadoggie01
Sep 11 at 19:25
add a comment |Â
up vote
2
down vote
Retina 0.8.2, 130 bytes
$
;42833
O`;.5
b(4+),(?=.*;42833;)
&$1&,
&
.12$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Uses Excel date stamps (days since 1899-12-31 but including 1900-02-49). 141 bytes for a version that takes ISO dates:
$
;2017-04-08
O`;.10
b(4+),(?=.*;2017-04-08;)
&$1&,
&
.22$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Explanation:
$
;2017-04-08
Append the cut-off date to the input.
O`;.10
Sort the dates. If the given date is on or after the cut-off date then the first date will be the cut-off date.
b(4+),(?=.*;2017-04-08;)
&$1&,
&
In that case, wrap the 4+
in
(using two stages as it saves a byte).
.22$
Delete the dates as they have done their job.
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
If there's an unspaced 4+
, then append the meme.
(.+?),
<s>$1</s>,
Strike out all of the obsolete byte counts.
You can save 5 bytes by taking the date-format without-
.
â Kevin Cruijssen
Aug 8 at 9:11
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
Hmm.. You know what, that's also fine by me. How the if-statement for the dateApril 8th, 2017
is done I don't really care. It's not the major part of this challenge.
â Kevin Cruijssen
Aug 8 at 11:12
That would be42832
for April 8th, 2017 I assume?
â Kevin Cruijssen
Aug 8 at 11:18
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
 |Â
show 3 more comments
up vote
2
down vote
Retina 0.8.2, 130 bytes
$
;42833
O`;.5
b(4+),(?=.*;42833;)
&$1&,
&
.12$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Uses Excel date stamps (days since 1899-12-31 but including 1900-02-49). 141 bytes for a version that takes ISO dates:
$
;2017-04-08
O`;.10
b(4+),(?=.*;2017-04-08;)
&$1&,
&
.22$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Explanation:
$
;2017-04-08
Append the cut-off date to the input.
O`;.10
Sort the dates. If the given date is on or after the cut-off date then the first date will be the cut-off date.
b(4+),(?=.*;2017-04-08;)
&$1&,
&
In that case, wrap the 4+
in
(using two stages as it saves a byte).
.22$
Delete the dates as they have done their job.
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
If there's an unspaced 4+
, then append the meme.
(.+?),
<s>$1</s>,
Strike out all of the obsolete byte counts.
You can save 5 bytes by taking the date-format without-
.
â Kevin Cruijssen
Aug 8 at 9:11
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
Hmm.. You know what, that's also fine by me. How the if-statement for the dateApril 8th, 2017
is done I don't really care. It's not the major part of this challenge.
â Kevin Cruijssen
Aug 8 at 11:12
That would be42832
for April 8th, 2017 I assume?
â Kevin Cruijssen
Aug 8 at 11:18
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
 |Â
show 3 more comments
up vote
2
down vote
up vote
2
down vote
Retina 0.8.2, 130 bytes
$
;42833
O`;.5
b(4+),(?=.*;42833;)
&$1&,
&
.12$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Uses Excel date stamps (days since 1899-12-31 but including 1900-02-49). 141 bytes for a version that takes ISO dates:
$
;2017-04-08
O`;.10
b(4+),(?=.*;2017-04-08;)
&$1&,
&
.22$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Explanation:
$
;2017-04-08
Append the cut-off date to the input.
O`;.10
Sort the dates. If the given date is on or after the cut-off date then the first date will be the cut-off date.
b(4+),(?=.*;2017-04-08;)
&$1&,
&
In that case, wrap the 4+
in
(using two stages as it saves a byte).
.22$
Delete the dates as they have done their job.
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
If there's an unspaced 4+
, then append the meme.
(.+?),
<s>$1</s>,
Strike out all of the obsolete byte counts.
Retina 0.8.2, 130 bytes
$
;42833
O`;.5
b(4+),(?=.*;42833;)
&$1&,
&
.12$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Uses Excel date stamps (days since 1899-12-31 but including 1900-02-49). 141 bytes for a version that takes ISO dates:
$
;2017-04-08
O`;.10
b(4+),(?=.*;2017-04-08;)
&$1&,
&
.22$
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
(.+?),
<s>$1</s>,
Try it online! Link includes test cases. Explanation:
$
;2017-04-08
Append the cut-off date to the input.
O`;.10
Sort the dates. If the given date is on or after the cut-off date then the first date will be the cut-off date.
b(4+),(?=.*;2017-04-08;)
&$1&,
&
In that case, wrap the 4+
in
(using two stages as it saves a byte).
.22$
Delete the dates as they have done their job.
b(4+),.*
$&öcrossed out $1 is still regular $1 ;(
If there's an unspaced 4+
, then append the meme.
(.+?),
<s>$1</s>,
Strike out all of the obsolete byte counts.
edited Aug 8 at 19:59
answered Aug 8 at 9:05
Neil
75.8k744171
75.8k744171
You can save 5 bytes by taking the date-format without-
.
â Kevin Cruijssen
Aug 8 at 9:11
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
Hmm.. You know what, that's also fine by me. How the if-statement for the dateApril 8th, 2017
is done I don't really care. It's not the major part of this challenge.
â Kevin Cruijssen
Aug 8 at 11:12
That would be42832
for April 8th, 2017 I assume?
â Kevin Cruijssen
Aug 8 at 11:18
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
 |Â
show 3 more comments
You can save 5 bytes by taking the date-format without-
.
â Kevin Cruijssen
Aug 8 at 9:11
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
Hmm.. You know what, that's also fine by me. How the if-statement for the dateApril 8th, 2017
is done I don't really care. It's not the major part of this challenge.
â Kevin Cruijssen
Aug 8 at 11:12
That would be42832
for April 8th, 2017 I assume?
â Kevin Cruijssen
Aug 8 at 11:18
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
You can save 5 bytes by taking the date-format without
-
.â Kevin Cruijssen
Aug 8 at 9:11
You can save 5 bytes by taking the date-format without
-
.â Kevin Cruijssen
Aug 8 at 9:11
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
@KevinCruijssen I could save even more bytes by asking for it as an Excel date (days since 1899-12-31). How far can I go with this?
â Neil
Aug 8 at 10:13
Hmm.. You know what, that's also fine by me. How the if-statement for the date
April 8th, 2017
is done I don't really care. It's not the major part of this challenge.â Kevin Cruijssen
Aug 8 at 11:12
Hmm.. You know what, that's also fine by me. How the if-statement for the date
April 8th, 2017
is done I don't really care. It's not the major part of this challenge.â Kevin Cruijssen
Aug 8 at 11:12
That would be
42832
for April 8th, 2017 I assume?â Kevin Cruijssen
Aug 8 at 11:18
That would be
42832
for April 8th, 2017 I assume?â Kevin Cruijssen
Aug 8 at 11:18
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
@KevinCruijssen My Excel says that's the 7th.
â Neil
Aug 8 at 11:33
 |Â
show 3 more comments
up vote
1
down vote
Ruby, 208 184 180 bytes
TIO-test
Thanks for @KevinCruijssen for saving 2 bytes!
->n,d*h,t=n;i=20170408>d;f=?n;h.map==[4];f=o&&i ?f+"crossed out #u is still regular #u ;(":f;o&&!i ?"<s> #u </s>":"<s>#u</s>"*", "+", #t"+f
It's a lambda function that takes a list of numbers and an integer as a date in the format of YYYYmmdd
.
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)
â Kevin Cruijssen
Aug 9 at 12:41
add a comment |Â
up vote
1
down vote
Ruby, 208 184 180 bytes
TIO-test
Thanks for @KevinCruijssen for saving 2 bytes!
->n,d*h,t=n;i=20170408>d;f=?n;h.map==[4];f=o&&i ?f+"crossed out #u is still regular #u ;(":f;o&&!i ?"<s> #u </s>":"<s>#u</s>"*", "+", #t"+f
It's a lambda function that takes a list of numbers and an integer as a date in the format of YYYYmmdd
.
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)
â Kevin Cruijssen
Aug 9 at 12:41
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Ruby, 208 184 180 bytes
TIO-test
Thanks for @KevinCruijssen for saving 2 bytes!
->n,d*h,t=n;i=20170408>d;f=?n;h.map==[4];f=o&&i ?f+"crossed out #u is still regular #u ;(":f;o&&!i ?"<s> #u </s>":"<s>#u</s>"*", "+", #t"+f
It's a lambda function that takes a list of numbers and an integer as a date in the format of YYYYmmdd
.
Ruby, 208 184 180 bytes
TIO-test
Thanks for @KevinCruijssen for saving 2 bytes!
->n,d*h,t=n;i=20170408>d;f=?n;h.map==[4];f=o&&i ?f+"crossed out #u is still regular #u ;(":f;o&&!i ?"<s> #u </s>":"<s>#u</s>"*", "+", #t"+f
It's a lambda function that takes a list of numbers and an integer as a date in the format of YYYYmmdd
.
edited Aug 9 at 13:07
answered Aug 9 at 12:19
Peter Lenkefi
1,392520
1,392520
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)
â Kevin Cruijssen
Aug 9 at 12:41
add a comment |Â
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)
â Kevin Cruijssen
Aug 9 at 12:41
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
Would it be possible to add a TIO-link with test code? And switching formats so it's an integer input would indeed save some bytes. :)
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
@KevinCruijssen Added link ;)
â Peter Lenkefi
Aug 9 at 12:27
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the
?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)â Kevin Cruijssen
Aug 9 at 12:41
Thanks! +1 from me. You can save 2 bytes by removing the spaces after the
?
. Also, for your TIO, you can split your actual submission code and test code with the header/footer, like this. :)â Kevin Cruijssen
Aug 9 at 12:41
add a comment |Â
up vote
1
down vote
JavaScript, 194 bytes
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
add a comment |Â
up vote
1
down vote
JavaScript, 194 bytes
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
add a comment |Â
up vote
1
down vote
up vote
1
down vote
JavaScript, 194 bytes
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
JavaScript, 194 bytes
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
f=
(a,d,l=a.pop(),n=a.find(x=>/^4+$/.exec(x)),s=a.map(n=>`<s>$n</s>, `).join``+l)=>d<1491609600?n?s+`
crossed out $n is still regular $n ;(`:s:s.replace(/>(4+)</g,(_,m)=>`> $m <`)
const date = s => Date.parse(s) / 1000
for(const output of [
f([50, 48, 44, 41], date('January 1, 2017')),
f([500, 475, 444, 301, 248], date('June 2, 2018')),
f([8, 6, 4], date('December 5, 2017')),
f([8, 6, 4, 3, 2], date('September 15, 2015')),
f([119, 99, 84, 82, 74, 60, 51, 44, 36, 34], date('February 29, 2016')),
f([404, 123, 44], date('March 4, 2016')),
f([4, 3], date('April 8, 2017')),
f([44], date('October 22, 2017')),
f([50000, 44444, 1500], date('August 1, 2018')),
f([50, 38, 23], date('September 8, 2001')),
]) console.log(output)
answered Aug 10 at 4:03
![](https://i.stack.imgur.com/921Gk.png?s=32&g=1)
![](https://i.stack.imgur.com/921Gk.png?s=32&g=1)
darrylyeo
5,164934
5,164934
add a comment |Â
add a comment |Â
up vote
1
down vote
Haskell, 227 bytes
i=1>0;i('4':s)=i s;i(_:_)=0>1
f l d=m l++c where a=head$filter i l;t d|d<42832=("","ncrossed out "++a++" is still regular "++a++" ;(")|1>0=(" ","");(b,c)=t d;w n|i n=b++n++b|1>0=n;m[n]=n;m(x:s)="<s>"++w x++"</s>, "++m s
Try it online!
Run f
with list l
and date d
. 42832 is the changing date.
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
 |Â
show 1 more comment
up vote
1
down vote
Haskell, 227 bytes
i=1>0;i('4':s)=i s;i(_:_)=0>1
f l d=m l++c where a=head$filter i l;t d|d<42832=("","ncrossed out "++a++" is still regular "++a++" ;(")|1>0=(" ","");(b,c)=t d;w n|i n=b++n++b|1>0=n;m[n]=n;m(x:s)="<s>"++w x++"</s>, "++m s
Try it online!
Run f
with list l
and date d
. 42832 is the changing date.
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
 |Â
show 1 more comment
up vote
1
down vote
up vote
1
down vote
Haskell, 227 bytes
i=1>0;i('4':s)=i s;i(_:_)=0>1
f l d=m l++c where a=head$filter i l;t d|d<42832=("","ncrossed out "++a++" is still regular "++a++" ;(")|1>0=(" ","");(b,c)=t d;w n|i n=b++n++b|1>0=n;m[n]=n;m(x:s)="<s>"++w x++"</s>, "++m s
Try it online!
Run f
with list l
and date d
. 42832 is the changing date.
Haskell, 227 bytes
i=1>0;i('4':s)=i s;i(_:_)=0>1
f l d=m l++c where a=head$filter i l;t d|d<42832=("","ncrossed out "++a++" is still regular "++a++" ;(")|1>0=(" ","");(b,c)=t d;w n|i n=b++n++b|1>0=n;m[n]=n;m(x:s)="<s>"++w x++"</s>, "++m s
Try it online!
Run f
with list l
and date d
. 42832 is the changing date.
edited Aug 11 at 11:52
![](https://i.stack.imgur.com/G7LUI.jpg?s=32&g=1)
![](https://i.stack.imgur.com/G7LUI.jpg?s=32&g=1)
Laikoni
18.7k33388
18.7k33388
answered Aug 8 at 18:47
ÃÂòóõýøù ÃÂþòøúþò
822116
822116
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
 |Â
show 1 more comment
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
Would it be possible to add a TIO-link with test code?
â Kevin Cruijssen
Aug 9 at 12:21
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
@KevinCruijssen in Russia it's banned
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 15:38
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
Oh, didn't knew that. Well, I don't know Haskell too well, otherwise I would have tested it myself a bit. But the code itself seems logical, so +1 from me nonetheless.
â Kevin Cruijssen
Aug 9 at 16:39
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen you can copy code to TIO, make link and add it to post
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:12
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
@KevinCruijssen TIO is banned by mistake, but I'm too lazy to use proxy/contact ISP about it
â ÃÂòóõýøù ÃÂþòøúþò
Aug 9 at 20:18
 |Â
show 1 more comment
up vote
1
down vote
JavaScript (Node.js), 173 bytes
a=>d=>a.map(x=>--i<1?x:`<s>$(b=/^4+$/.exec(x)?(c=x,d)<14915808e5?n=:" ":"")+x+b</s>`,n="",c=0,i=a.length).join`, `+(n&&`
crossed out $c is still regular $c ;(`)
Try it online!
Using curry syntax f(array)(js_timestamp)
add a comment |Â
up vote
1
down vote
JavaScript (Node.js), 173 bytes
a=>d=>a.map(x=>--i<1?x:`<s>$(b=/^4+$/.exec(x)?(c=x,d)<14915808e5?n=:" ":"")+x+b</s>`,n="",c=0,i=a.length).join`, `+(n&&`
crossed out $c is still regular $c ;(`)
Try it online!
Using curry syntax f(array)(js_timestamp)
add a comment |Â
up vote
1
down vote
up vote
1
down vote
JavaScript (Node.js), 173 bytes
a=>d=>a.map(x=>--i<1?x:`<s>$(b=/^4+$/.exec(x)?(c=x,d)<14915808e5?n=:" ":"")+x+b</s>`,n="",c=0,i=a.length).join`, `+(n&&`
crossed out $c is still regular $c ;(`)
Try it online!
Using curry syntax f(array)(js_timestamp)
JavaScript (Node.js), 173 bytes
a=>d=>a.map(x=>--i<1?x:`<s>$(b=/^4+$/.exec(x)?(c=x,d)<14915808e5?n=:" ":"")+x+b</s>`,n="",c=0,i=a.length).join`, `+(n&&`
crossed out $c is still regular $c ;(`)
Try it online!
Using curry syntax f(array)(js_timestamp)
answered Sep 14 at 7:07
Shieru Asakoto
1,660311
1,660311
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f170188%2fcrossed-out-44-is-still-regular-44%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Your last test case is missing its date?
â Neil
Aug 8 at 8:47
@Neil Ah oops.. Fixed. Date doesn't really matter for that one, but added one regardless. Thanks for noticing.
â Kevin Cruijssen
Aug 8 at 8:49
1
I can confirm that I had not noticed anyone use the non-breaking space for this specific purpose and that was why I wrote the "no longer" text.
â Jonathan Allan
Aug 8 at 9:16
(I can also confirm that I had used it prior to using it with 44 - I believe that is when I first used them)
â Jonathan Allan
Aug 8 at 9:35
As we can take input as days since
1889-12-31
, can we also take days since2017-04-08
?â TFeld
Aug 8 at 11:49