crossed out 44 is still regular 44 ;(
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
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!
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