#Mathematica: 272
Mathematica: 272
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y,m,d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 272
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y,m,d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
Mathematica: 272
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y,m,d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 274272
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y,m,d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 274
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y,m,d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 272
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y,m,d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 274
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y, m, d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o]4]+o,4]]]4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 274
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y, m, d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o],4]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]
#Mathematica: 274
S=ToExpression
T=StringSplit
{a,b,c}=T[i,"*"]
{d,m,y}=S@T[c,"/"]
{{e}}=Position[DayOfWeek[{y,m,#}]&/@Table[i,{i,7}],Monday]
{o,p,q}=DateDifference[Join[{y},#],{y, m, d}]&/@{{1,e},{7,21},{2,29}}
{"NW","SE","SW","NE"}[[1+If[p==0||q==0,0,Mod[2*Mod[S@b-1,2]+Mod[S@a-1,4]+o,4]]]]
Assumes that the input string is in a variable named i like so (perhaps add 4 chars for i=""?):
i = "2*1*20/01/2014"
Also I leave the following out of the character count (perhaps add 18 for that):
Needs["Calendar`"]
And the trailing ; on each of the non-output lines (perhaps add 9 for those). Below is a slightly ungolfed version of the code for testing/editing:
i = "2*1*20/01/2014";
Needs["Calendar`"];
R = Mod[#, 4] &;
S = ToExpression;
T = StringSplit;
{a, b, c} = T[i, "*"];
{d, m, y} = S@T[c, "/"];
{{e}} = Position[DayOfWeek[{y, m, #}] & /@ Table[i, {i, 7}], Monday];
{o, p, q} = DateDifference[Join[{y}, #], {y, m, d}] & /@ {{1, e}, {7, 21}, {2, 29}};
{"NW", "SE", "SW", "NE"}[[1 + If[p == 0 || q == 0, 0, Mod[2*Mod[S@b - 1, 2] + Mod[S@a - 1, 4] + o, 4]]]]