R, 1023(削除) 1023 (削除ここまで) 985 bytes
function(s){x=strsplit("Batong=strsplit
y="Bat9 Rouge,IndianapolisIndi2apol3,Columbus,MontgomeryM9tgomery,HelenaHel6a,DenverD6ver,BoiseBo3e,AustinAust1,BostonBost9,AlbanyAlb2y,TallahasseeTallah5s4,SantaS2ta Fe,NashvilleN5hville,TrentonTr6t9,JeffersonJeffers9,RichmondRichm9d,Pierre,HarrisburgH7r3burg,Augusta,ProvidenceProvid6ce,Dover,ConcordC9c0d,MontpelierM9tpelier,HartfordH7tf0d,Topeka,SaintSa1t Paul,Juneau,LincolnL1coln,Raleigh,MadisonMad39,Olympia,PhoenixPho6ix,LansingL2s1g,HonoluluH9olulu,JacksonJacks9,SpringfieldSpr1gfield,Columbia,AnnapolisAnnapol3,CheyenneChey6ne,Salt Lake CityLake8,AtlantaAtl2ta,BismarckB3m7ck,FrankfortFr2kf0t,Salem,Little Rock,Des MoinesMo1es,SacramentoSacram6to,Oklahoma CityOklahoma8,CharlestonCh7lest9,Carson CityC7s98,Nevada,West VirginiaVirg1ia,Oklahoma,CaliforniaCalif0nia,Iowa,ArkansasArk2s5,OregonOreg9,KentuckyK6tucky,NorthN0th Dakota,GeorgiaGe0gia,Utah,WyomingWyom1g,MarylandM7yl2d,South CarolinaC7ol1a,IllinoisIll1o3,MississippiM3s3sippi,Hawaii,MichiganMichig2,ArizonaAriz9a,WashingtonW5h1gt9,WisconsinW3c9s1,NorthN0th CarolinaC7ol1a,NebraskaNebr5ka,AlaskaAl5ka,MinnesotaM1nesota,KansasK2s5,ConnecticutC9necticut,VermontVerm9t,New Hampshire,DelawareDelaw7e,Rhode IslandIsl2d,MaineMa1e,PennsylvaniaP6nsylv2ia,South Dakota,VirginiaVirg1ia,MissouriM3souri,New Jersey,TennesseeT6ness4,New Mexico,FloridaFl0ida,New YorkY0k,MassachusettsM5sachusetts,TexasTex5,Idaho,ColoradoCol0ado,MontanaM9t2a,Alabama,Ohio,IndianaIndi2a,Louisiana"Lou3i2a"
for(i in 0:9)y=gsub(i,g("or,in,an,is,ee,as,en,ar, City,on",",")[[1]][i+1],y)
x=g(y,",")[[1]]
'if'({y=match(s,x,0)},x[length(x)x[101-y+1]y],'Arstotzka')}
Different from the other R submission.
The code puts the capitals and states in the same vector. The states are in reverse order so that, given the index of either the state or the capital, the matching entry's index is length(datedata)-index+1, where length(data)=100, 50 (states) + 50 (capitals)
Also, the input data is packed as a single string and then split. The string could be compressed to golf it further.
Edit: added some unoptimized substitution of pairs of characters.
R, 1023 bytes
function(s){x=strsplit("Baton Rouge,Indianapolis,Columbus,Montgomery,Helena,Denver,Boise,Austin,Boston,Albany,Tallahassee,Santa Fe,Nashville,Trenton,Jefferson,Richmond,Pierre,Harrisburg,Augusta,Providence,Dover,Concord,Montpelier,Hartford,Topeka,Saint Paul,Juneau,Lincoln,Raleigh,Madison,Olympia,Phoenix,Lansing,Honolulu,Jackson,Springfield,Columbia,Annapolis,Cheyenne,Salt Lake City,Atlanta,Bismarck,Frankfort,Salem,Little Rock,Des Moines,Sacramento,Oklahoma City,Charleston,Carson City,Nevada,West Virginia,Oklahoma,California,Iowa,Arkansas,Oregon,Kentucky,North Dakota,Georgia,Utah,Wyoming,Maryland,South Carolina,Illinois,Mississippi,Hawaii,Michigan,Arizona,Washington,Wisconsin,North Carolina,Nebraska,Alaska,Minnesota,Kansas,Connecticut,Vermont,New Hampshire,Delaware,Rhode Island,Maine,Pennsylvania,South Dakota,Virginia,Missouri,New Jersey,Tennessee,New Mexico,Florida,New York,Massachusetts,Texas,Idaho,Colorado,Montana,Alabama,Ohio,Indiana,Louisiana",",")[[1]]
'if'({y=match(s,x,0)},x[length(x)-y+1],'Arstotzka')}
Different from the other R submission.
The code puts the capitals and states in the same vector. The states are in reverse order so that, given the index of either the state or the capital, the matching entry's index is length(date)-index+1
Also, the input data is packed as a single string and then split. The string could be compressed to golf it further.
R, (削除) 1023 (削除ここまで) 985 bytes
function(s){g=strsplit
y="Bat9 Rouge,Indi2apol3,Columbus,M9tgomery,Hel6a,D6ver,Bo3e,Aust1,Bost9,Alb2y,Tallah5s4,S2ta Fe,N5hville,Tr6t9,Jeffers9,Richm9d,Pierre,H7r3burg,Augusta,Provid6ce,Dover,C9c0d,M9tpelier,H7tf0d,Topeka,Sa1t Paul,Juneau,L1coln,Raleigh,Mad39,Olympia,Pho6ix,L2s1g,H9olulu,Jacks9,Spr1gfield,Columbia,Annapol3,Chey6ne,Salt Lake8,Atl2ta,B3m7ck,Fr2kf0t,Salem,Little Rock,Des Mo1es,Sacram6to,Oklahoma8,Ch7lest9,C7s98,Nevada,West Virg1ia,Oklahoma,Calif0nia,Iowa,Ark2s5,Oreg9,K6tucky,N0th Dakota,Ge0gia,Utah,Wyom1g,M7yl2d,South C7ol1a,Ill1o3,M3s3sippi,Hawaii,Michig2,Ariz9a,W5h1gt9,W3c9s1,N0th C7ol1a,Nebr5ka,Al5ka,M1nesota,K2s5,C9necticut,Verm9t,New Hampshire,Delaw7e,Rhode Isl2d,Ma1e,P6nsylv2ia,South Dakota,Virg1ia,M3souri,New Jersey,T6ness4,New Mexico,Fl0ida,New Y0k,M5sachusetts,Tex5,Idaho,Col0ado,M9t2a,Alabama,Ohio,Indi2a,Lou3i2a"
for(i in 0:9)y=gsub(i,g("or,in,an,is,ee,as,en,ar, City,on",",")[[1]][i+1],y)
x=g(y,",")[[1]]
'if'({y=match(s,x,0)},x[101-y],'Arstotzka')}
Different from the other R submission.
The code puts the capitals and states in the same vector. The states are in reverse order so that, given the index of either the state or the capital, the matching entry's index is length(data)-index+1, where length(data)=100, 50 (states) + 50 (capitals)
Also, the input data is packed as a single string and then split. The string could be compressed to golf it further.
Edit: added some unoptimized substitution of pairs of characters.
R, 1023 bytes
function(s){x=strsplit("Baton Rouge,Indianapolis,Columbus,Montgomery,Helena,Denver,Boise,Austin,Boston,Albany,Tallahassee,Santa Fe,Nashville,Trenton,Jefferson,Richmond,Pierre,Harrisburg,Augusta,Providence,Dover,Concord,Montpelier,Hartford,Topeka,Saint Paul,Juneau,Lincoln,Raleigh,Madison,Olympia,Phoenix,Lansing,Honolulu,Jackson,Springfield,Columbia,Annapolis,Cheyenne,Salt Lake City,Atlanta,Bismarck,Frankfort,Salem,Little Rock,Des Moines,Sacramento,Oklahoma City,Charleston,Carson City,Nevada,West Virginia,Oklahoma,California,Iowa,Arkansas,Oregon,Kentucky,North Dakota,Georgia,Utah,Wyoming,Maryland,South Carolina,Illinois,Mississippi,Hawaii,Michigan,Arizona,Washington,Wisconsin,North Carolina,Nebraska,Alaska,Minnesota,Kansas,Connecticut,Vermont,New Hampshire,Delaware,Rhode Island,Maine,Pennsylvania,South Dakota,Virginia,Missouri,New Jersey,Tennessee,New Mexico,Florida,New York,Massachusetts,Texas,Idaho,Colorado,Montana,Alabama,Ohio,Indiana,Louisiana",",")[[1]]
'if'({y=match(s,x,0)},x[length(x)-y+1],'Arstotzka')}
Different from the other R submission.
The code puts the capitals and states in the same vector. The states are in reverse order so that, given the index of either the state or the capital, the matching entry's index is length(date)-index+1
Also, the input data is packed as a single string and then split. The string could be compressed to golf it further.