trunk
HeNine 3 years ago
parent 3118d877a3
commit ea18b6e453

@ -0,0 +1,4 @@
name = "day08"
uuid = "27a5047e-ad93-4828-9025-931db76b55c7"
authors = ["HeNine "]
version = "0.1.0"

@ -0,0 +1,10 @@
be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe
edbfga begcd cbg gc gcadebf fbgde acbgfd abcde gfcbed gfec | fcgedb cgb dgebacf gc
fgaebd cg bdaec gdafb agbcfd gdcbef bgcad gfac gcb cdgabef | cg cg fdcagb cbg
fbegcd cbd adcefb dageb afcb bc aefdc ecdab fgdeca fcdbega | efabcd cedba gadfec cb
aecbfdg fbg gf bafeg dbefa fcge gcbea fcaegb dgceab fcbdga | gecf egdcabf bgf bfgea
fgeab ca afcebg bdacfeg cfaedg gcfdb baec bfadeg bafgc acf | gebdcfa ecba ca fadegcb
dbcfg fgd bdegcaf fgec aegbdf ecdfab fbedc dacgb gdcebf gf | cefg dcbef fcge gbcadfe
bdfegc cbegaf gecbf dfcage bdacg ed bedf ced adcbefg gebcd | ed bcgafe cdgba cbgef
egadfb cdbfeg cegd fecab cgb gbdefca cg fgcdab egfdb bfceg | gbdfcae bgc cg cgb
gcafb gcf dcaebfg ecagb gf abcdeg gaef cafbge fdbac fegbdc | fgae cfgab fg bagce

@ -0,0 +1,200 @@
fdb bgfa cedfg abedcf defgba gbaed dagfbce fbged dgabce fb | bf dfbega fb baged
ce cgfdea acdfe befda afgdc fec gdfbca ebdcgf cgea adgcfeb | fgcadbe cefda aebdf degcfa
egca gdcaeb cbdfe bdaegf dgbafec ge agdcfb degcb cgadb ebg | edfbc bcdeg bfcde baefdg
dfbc bc facgd feagb bfadegc gacfbd acgfb bagedc gacdfe cbg | afdcegb bagfc egcafd bcg
edc aedcbf dgcf cgebf egdacbf bdega egcbfa gcedb cd edgcbf | gdcebf bedfgc dbcgfe cd
gcfabed fed facegd abdge gcdfb fbdge befa abgdfe dgbcae ef | bgdfe befa fgedb adcbeg
fca fbdcega cadfg ac dbca dbcgf cgfaeb dbefcg gcfbad gafde | gfbacd fdgea gdfcb bdac
eb bgafe bgcefd fegcadb daeb eafcg gbdaf bfe edgabf agfbcd | cfdebg aegbf dbagf dgbfea
aebfgd gbcead dfbecga gdceb decfbg aeg ae gacfd eacb edgac | ea aeg ea dfaegb
gdc fceagd cagf cgfdbe febcad gecad gc agdeb fcade bfaecgd | fdaecg gdc cegafd adebg
bdgcef acd bdgacf gbcfd da agbcd bfda eadgcf bcgea cfbgade | fcbaged bfdegc gecdabf adbf
bd faebcg cdgfa fcbda fbd fbcae aebd bgcdef gebcafd cdaebf | dbae fbd gcebfa gacfd
gbaefc gbfdec gfdbe edbgcaf fdab dfgabe gadec agbde ba gab | bag fegdb badecfg bag
feba fb fgbca acfdg gcfedb fdbecga eacgb abcgef fbc adgbce | gcfba afeb gbafc ebgfdc
fegbc abdfce egdba cea cgabe faegdcb edfgcb cefbag afcg ca | dbgcfe gfac bgead aegbcf
acdbf gfebc afe ea fdeagb fgbaced cfeadb eacd fgdcab bfaec | bgadfc bfaedc agcdbf ecgadbf
cefag dbgecf cfbga dfceag gdfcbea dfebac eg cge gdae cadfe | dagebfc ge ge cbdfae
cgefabd agbdc dgef bedfac gcf cafgd dfegac fg fadec afgebc | decabf febdacg bcdag fgc
dfe bdfa gfeabd dacbegf agcfeb edacg efagd gedcfb bfgea fd | aedgc fd febag acgde
dgcf efbcga adgfbc gbcfa adfebc eabgfdc dc acd dcabg egadb | fcdeba egcabf acfdgb dbgac
cagfdb eagdc ea gacedfb beac bagdec gdfbae eag cgfed dacbg | dafgbe adegc daegc adcge
adf ecgbda afegb dbacgf adfgb ecgfbda cgdf fd dacbfe cgdab | eadgbc adgbf gdaebc gdebcfa
abfecd gdbaf cdfg bfd gacfbd df badegcf fgcba acebgf eabgd | abcfde edbag cfegab fdegbca
cdfeba dbec dc dfcea bdfea cafebdg gadfcb cagfe fcd abgfed | gdabfc eacfg cabfde bdfgca
eadcgb acefd degac dgface bcfaegd baegdf cfdg df ecbfa def | cefad dcgf fde feadc
ceagbd bedgfac efbdc gd edgbc gbad gdc ebgca fgecba egcfad | ebgdca fcgade edgabc fagebc
aedbcgf fg agfdc gbcad edfcgb egcdaf daecfb fgd ceafd afge | defac fg gedfcb gdcfeba
egfbda dbcfeg gafc abdce dgfabec afged adegc cgdfea dgc cg | gcd degfa cbead bagefd
de aedbf aed acfgde ebgaf cafdgeb cdfab defabg bedg acefbg | efdba befag dbafc fcaged
cdgfba dfb efadbcg dfea ecfabg gdabef gbafe dcebg fegbd fd | fgaeb dfabge eabgf gdefb
bagcef fabeg ebca fbged afe cdefag gcdbfa bfagc agdfbce ae | fdgbe cbgaf bace gbdef
eafdg dfc cdfgbe bdce cebgfa gfceb dgcfe cd begafcd gdcfba | edbafgc ebgfc fcedg aefdg
aegf bgedc cfbega fgcbda cfgeb gf eafcdb feabgdc fgc feabc | cedgb facebd bgadfc gefcb
ebacgd faecb bd cdb cgaed bdeg fgbdca dcgafe eabcd afdbegc | dbc deacg dceba gfbacd
aeb dcabge ba edacf bdaf fcgeb cfabde agfbdce afcbe aefdgc | abfd fgecad gdaecf afcgde
dbgc gfcea cafgd fgcdab dg abdfc bcgeafd fgd eabfdc gdaefb | deabfg cgbd dcfbag cefag
cabgfe baedcg cgd dg acfeg adgf bfecd fbegcad egcdf fgdace | cdg egcfba defgc acbedg
ef fbcgd afde eafcgb bfgcdae dfacge egdabc eagdc gecfd cfe | caged efgdc gdeacf fe
ae dfeabc fgea fbcegd fcdge ace cgdae bcefadg dbagc dcafeg | cgadb becafd dcbag fgae
eafdbg fdgc fgeadc egacd egd ebcad bgfeca acefg fdgeabc gd | afebgd cfeadg gd ecbda
ebgfc agcbd bgcdef ea gfea eafgbc cae ecbfad cegba egdbcfa | cafbde dgcfbe aebcfd badefc
badfce cf ebgcd acgbfed afdgeb bfagec baedf cdbfe efc dcfa | debaf bgedfca facebgd ceabgf
ebfac dba ecgbaf ad cbfdega edcbaf feda cebgda cdafb dcbfg | dacbf adb fgacdeb fdcba
acdebgf gbdefa gaebd dgb gbfe aedcg aedfb afdebc gb cdagfb | geadb adfgceb eacgd debcaf
adfb adfgce ecafd dgbace bd cfegb bfeadc begdcaf fedbc bdc | bd ecdabf dceaf dbc
gaceb fg edbgca gafb fcbeg bfaegc eadcfg gcf bfdcega bcdfe | eacfgd becadfg gf fcbed
bdfcg ad begac gfbadc dga abcgd dcaf gcdaefb gcbdfe gefdba | dfbcg cdabg adcbg dagbc
febgdac fgadce fa gdfbc dcgfba gcfebd afc gabcf bagec bdfa | agbec bdfa gcbaf fbcgde
bdfgae fgead faebgc dabg bcfdge gde gefba gd edcbafg dcfae | cgfaeb fgcabe cafgeb gdcbfe
eadcbf agfdb bfa ab dfgbc faedg aegb dcfaebg gbfaed dfcaeg | fagbd dfgab fgadb adfceg
gaedc aegdcbf bdgf feagbc cedfg dbfec ecdbgf fge fg cbdaef | agedc dbfegc fg efcdg
db becfag abd agebd bgcae bced efdag gbcade gbcadf gcbeafd | bd bdgefca dgeabc bd
febag deg gefdab becdag defa dbfge gbcfd gcbeaf bfdgaec de | fead bagef abfeg aefd
dfac aegcbfd aefcg daebgc eadcg fa bfeadg adgcef fae fgceb | cdeagfb fea cedgab bfcge
ed dbfgce efdcb bafcged dcge bcadf afecbg dfeagb fegbc edf | debgaf ebcdf de fdgbec
fadg dgefc da eafcd adc gdecbf bcgdae afecdbg dgafec caefb | caedf eagbcd gdaf gefdbca
degbcf gfdbace fbced bedg abgdfc gecfa fceadb ecbfg fgb gb | gb gbdfca dceabf fcegb
bagfce gfbac fbdcga ceab edagf eb afgeb gfdbec cfdbgea gbe | fdgceb fdage fgbac bfeag
afbecg aecdg bfcd dfecgb febgad efdcg fed aedgfbc df efbgc | dfcb dfcb cbgef fd
defca bgac egdfbc gfbea fgabde ceagdbf bfaecg cb afebc fcb | cb acfeb ecabf ebfca
cdfbga befa daebc afcdbe fdabceg aed gdcbe acfdge cafbd ea | dae cedbaf dcgeb afbe
dbefg gecad ecafgd aedgcb fecdba cb cbedg cbd ceabgfd bacg | fegdac eadgcf geabdc cedag
abdcfg eagf cgf ecgbd badfce cabgefd gbcef aecfb fcabeg gf | gf gabfdc cgebf abcfed
agdceb ebadc dfebc gbdac fegdac adbfgc cae ea befdgca ageb | edfbc acbefdg cdgefa bdcga
efca fgbca gabfe eab ae cfaegb caebdg abfgcd dfgbe cadbgef | bfacge fabcgd eafbgc cfgbad
cedbgf efbagcd aegdcb dabef feb ef badgf cdeba acfe ecdfab | ef eadfb baedcg edfacb
af gfa egbdf ecgabd afcgdb fbadg facegd cbaf gcbda eacbdgf | abdcg gfadbec bfedg cdbga
dgbea afeg ef cbedfg cbgdea fcabd adfbe efd efdgba gecfbda | cfbaged ecbagd fbgecd ebgda
gcbeaf bf ebadfg dafb bcgde daegf cagfde bdacefg bfe dgebf | gceadf gefacb fgdeba gfbdea
dgafbe dgfce cb cbafde eadbf dbca cbf cedfb gfaceb fdegbca | bedacgf bfc cdab ecbagf
cadbef dfgac gfb bcedf gbdafe cgbe gdcfb cagbdef egfbcd bg | gdfbc ecbfdga bdcgf bacgfed
dfcb cd gdbae gabdfce bfceg bdcefg ced cfdeag ebdcg efgcba | fgecba edbgcf cbgfed fgdeac
ebgdcf cdfa cgafe ace gfedc cadfge aebgf adgceb fdecgab ac | cegdf gfeba edcfg ac
agbefd bdgfe fdcegb dce ebgcd bcdga decbafg ec eacfgd cbfe | ec edgbc cgdba ec
bgadc adbecfg gdbfce fdg dfeac agfb fdgac fg cbfgad dcgeba | gf dcfbge bgadc fg
badegf abegc dfgc gbdaf fdgaebc cgbfa cf dcbaef cdbgaf bfc | dabgf cageb adfgb bdfagc
ce abgdef ecdg fgbca fdage cadgef eca acfge acfbde bedfgca | cfage bagfc gbcfa eac
gdfbe gcfeb febgda cfb fedc baceg ecgdfab dagbfc cf fbcdge | gfebc cgdefb bcf gebca
gceabd bc ecb bdcef ebfacd fgeadcb abfc dgfec bdafge fdeba | gcbefda egcdba ecbgad gfbead
gabec gaefbcd bgeaf ebf dbfag ef edgafb fbdgec fade bdfgac | bef abdgf fe ceagb
bcfaged fdbgc dafcg edfacg dfb fb bdagef cfba dgbec gfdacb | fadgc cgbfad dcbeg cafb
bdg bfdcae eagdb eacgd fagb afebd ebfcdg fcaegbd bg egdafb | fbedgc ebadf dgeabf aefbdc
ad cgadbef eabcfd fdabgc dba dbace ecdbf fdae bdfecg acegb | bcgfda gfdcbe eafcbd cbgea
efbda dcbfe bc bcfg egfcd gdcefb agbcde bec ecfadbg caefdg | dcagebf bc bfcdaeg cabfedg
agde gdacef adgfc cbdfaeg cgfde cde badfec abcfdg fbcge ed | cde eafbdc cdfbae afbecd
fdg bgfeac afgcbd bcfag fgeacd cdfb gbead fgdba cgfdaeb fd | bgacf gecdfa fd dfg
ga agc cedgbfa bcfdea fdgcb geab gfbca ceabf edafgc cgefba | bgcfa fcagde edbgafc becaf
agceb ecfgba decgaf eaf ef cdbaf gdcafbe fgeb gcaebd ecabf | fbdcage aegbdfc bagce fdagce
cdage aebfdc bgacf fbeagc cfd bgfd defcgab acfgd gafbcd fd | cfadg dbface dgbf gdfac
cefbda afcdb dgecfb dab cdefb bafdge ad deca gaecdfb acfbg | cbdgfe fecdb bdfce efbgdc
aefbd ebcgfa ad ade egfbd abcefd cfeab bacd afedcg dbcagfe | edcbaf gfedcab dfgeb gefbd
agdb ecfgb fcbaed agfdc bcd fgdcba faegbdc deacfg db dgcfb | dcb gcedfa agdfc bdacgfe
gdfeab gcdfeb dg fdebc bdacef fbcegad gbced cdgf edg baecg | gcdf dg gbeac bedcf
eb degbc bead cbegfa cdgfb gecad gbacde bce adfecg eafbgdc | dfaceg dbgce gcadfeb bcgdea
dgcefb cad gcbad da dfcgb bcega bcfgda afdg dbfceag fcdeab | egabc bgfdce gcadb fbacgd
gfadce eabfgc df gedab cdgf debcfa eagdbcf acgfe edfag afd | fadeg cbeadf aecgbf adfeg
abcdg fecd ged aegcfd dgeca afegcb afcge debgfa de eafgcbd | ged efcgda gefcad aegfc
gbfecd gafcdeb ebcgd efgbad fg dfgbc egcf egbdca fadbc fdg | dbacf gf fbdecg gdceabf
ebdf dbafc gdcabf dagecbf cabedf afgbce ef cfaed gecad aef | ef dacbf febd gcbafe
daebfg gfceadb agbde aegbc ebagcd cdgb cg baefc egc dgafce | cadbeg agbdec eafcb gebac
dcfgbe ca acgde begdc dabc efdag aecdgbf ceadbg cae aecbfg | cgebd bfedgc defga bdac
cbdf dacge fadec df dbafge eafcb fbdace dfa bgacfe cgafdeb | df eadcfb cdefa fecad
fb feb cgeab cagdbe ebfadc gbcf adfge aebfgc acgbdef bfgea | efcadb gdcbae fbe afegd
dgcf gaecb gfdeba bcdef dgb fgadcbe dg fdebca dcegb begfdc | bdg ceabg gabce gd
dagc gaedb dgeabc ag ebcdg age fcaebg adfbe cdefagb gbcdfe | bdceg gecabfd acdfegb gacfdeb
acefdg gacebd fdga bgdcfae afceg ecadf fgebc cdfbae gea ag | cfagde ega dcefab afdg
bcgadf defgb cfea ec gdeacb efadcbg ecd ecgadf edcgf fdcag | dce fdgbe egacbfd efcagd
dcagb dagbcef aedcgf deafb adbfg bfgc bgafdc gcedab gfa gf | gdfba fedba eafdcbg fg
fedacb gdbcae gefda fbcae gecafb afegc gca gc edfbgac fbcg | bgcf gac ecafgb egadf
ecfgb fdbega cbga gce bacfeg agfedc cbfgaed cefdb bgefa gc | dgacfe daefgcb gebfa ecg
gefadb dcfbge ag abg fbcad cfgbea edga dbegf dgfba egbcdaf | ebfdga adgcebf gbdecf dbgfeca
ecfgbd agde eacfgdb dgcabe edbcg facbd cabfeg bdace ea aeb | aeb fabdc egdcb ebacd
ecgfda af fac cgfde cgefbd fagecb daceb gafd ebfadcg efadc | af fcegd bgceaf fca
ca cgade adefgb dgfea edcbg dgeafc cfga dgbceaf dfaebc dca | cedga bdceg degfa ca
gfced dgecfb ga ceafbdg afedb acdg gfeadc cebgaf fag fdgae | cgfeab ga dcfeg dbafe
bcefda fcega dbga abgcdfe bgfdc dfgbce dca ad fgdac cadgbf | ad bacdgf da gcdeafb
gdcea caebgdf agfdeb cfabge cbdafg gef bcef acgfb ef fagec | ecgaf fcage acged fe
egc bdfge cedbg befc dabgecf dgfeac cgdab ce dcfebg bgfdea | dcgeaf ec egbfd ec
gcbdaef fd dbecag fde gcdf acebf fgdbea gbdcfe dcgbe cefbd | egfdab fd cgfabed cbdegf
abec baf ecgaf facgbe fecbdga ba fagecd bgcfda bfage dfbge | bgceadf ebdgf dfabgc acegfd
dca eafc dafcgb cbead efabd cfbade faedbgc gdecb gfbdae ac | adefb adfecb cfbeda acfe
eac becfgd fgadcbe geafd fcade eagbfc bcad ca abedcf fcbed | fcbed bacd fdgecb abcgfe
bfad cbged efdgbac gdefac fd acbgf bdfgc cafbdg acgebf cdf | fdcgae gabdcf gcbdaf cabfg
ebg bdfce gfecb dgceafb cafeg dgfcea cafegb gb cgadbe bgaf | cebgaf dcebag gbfa egacdfb
edbacf eba dbgcfea dbef abdcge bcgfad gcaef be ebfca cdafb | gbedca cbafd edfcab bdfe
fcdbae efacd aebd gbedfc afgdc gfcdeba aef efdbc ae cfbeag | bcfde abcgfe dcagebf gfbdce
abg gcdfb ag afegdbc bfagd bcdefa fedgab eagbcf deag adebf | ga bdgfc efabd edbagcf
fb befc egafcd gdbcf gecbafd fgb dgfce dcgba cdbgfe adebgf | cbgfde bf bdfceg edgbfa
gefab efdabcg eagcbf de eabdfg geda egcfdb faebd cadbf edb | aefcgb fbade de afbge
edfcgb ecadgb adbcf decbf fcgaed dfegc ebd dbagcef egfb be | gbef fgeb eacdgf dfacb
dfc ecfgad abcfd befgca cgfabd cagbf gbdc dcbaefg dc bdefa | cd ebafd dc fdc
aefgc cfdga acbefd gebdacf efg cbefga fceba eg begfdc bega | gbfdce dfbegc geba dagcf
cfgbad fadebgc cga efgcd afecgb ac acegf ebgfa fbgeda ebac | fgbedac ac ecba beca
dc gbcfda dbc egabc gcadbef agbcde bgdef deac bdecg gecafb | ecad gfbaec dc cegbd
cadgef eb cgdeab ceb cbgdf befgc egcbfa cefdgab fbae cfaeg | cgdbea acbefg gaefdc gbecf
cdfbea gbceda cgdfb cdbge geb acgefb dage eg afcgedb beacd | aebdcg gbdeafc ebdcga bcged
cgbfed ba agefdb acbedgf adegb dcega abdf abg gfbde gbcefa | bgedf dbgfe dfab edbfcg
ga geabc bfedacg efga bfgaec bgecf agb cdbfag abdec fcbegd | egfdbc cefabg ga gaebc
cfebg cfgbea acdgf edgbfc dgfabec db fdebac bedg dgfcb dbf | dcebfa egbd dfb fdcgeb
ecdgf ad ebdgac dca caebgf gebacfd fbace dabf bdecfa fecda | bagfecd dca abgcde bcefga
de def dbeafc dcbaf efacdgb cfagdb afcegd ecdb gfeba dabfe | bdec fadeb de febag
bdgfac ec cde fegc fdbeca fcgdb cedgfb gbecd fecbgda edagb | fcgabd ecfg bfadgc ec
gfc fcbagd fg dfeg gbeadcf becaf bcgeda cgaed acgfed ecgaf | eadcgb cbfea gdef ceagf
degac bcegd cedagb ebc agfbedc dfcgb adeb be cgadfe agcebf | eb daeb cgbed fcgdb
aebcfd feabgc fgbdca bfcag df fagbd fdagceb fcdg baedg fad | debag dcfbea bgdfa gbacfd
bef fe agebd fgacbe dcfba aebdf edfg gecdab fgcbdea afdebg | fdeba dbeaf bdceag adgbef
cdefb gcabdf cgbdefa eg ebg fbegd bafgce bdaegf dabgf dgae | geb bfgacd gdea abgfdc
acegdb fcge gceabf fadbe fgcba eagfdbc ce ceafb cafdbg ace | bfead dfcbgea faebd dfaeb
agbfe bcfgdae bca gcfb gefabd bdecfa deagc cb egfcab begac | becag gedac bfgc caedbf
adgef egcd gda beafd gcfbda cefdag gd dgcfeba egbcfa aefcg | abgdcef ebdfa edgc eafdb
adecf faebd gaefcb ebf bfdc badge efadbc bcfeagd agcedf bf | dgaeb edcfag fb cbegfa
gcfa becda dabgfe af ecfda efgadbc gcfaed egfcd fcgbde eaf | fae fecgd adfebg afedcg
gbacdfe gfaecb fgeab cg fecdbg bcafg aecg abcdf fgadeb cgf | ebcfag cbdgfe bgfecd gecfbd
adgcef gfbde dafcgb bceagd edbgc dbc baec bc eadfbgc ecgda | cb gdbeca facdeg fdbge
fgabe ad dfbce fad facebg fbeadg fcgaed ebafd bgad gfceadb | dcfeb egdbaf fbecd efcdb
bgfdc gbacef fgdeba abefg afec bcgfe aebfdgc ceg degacb ec | ec fegab fgcbe ec
egfdc cbagdef fcaed fdg dcefbg dbcge fg dcbega bcfgad befg | cdeaf dgf abcgdf edfcg
cdfgaeb eagcd decf efdcga ed fagdc gabec egd bfedag bdgacf | cdef eabcg acegdf egbac
badfecg gdfabc bd dba acgbd fbdaec gbdf agbfc gecda fbcega | dbgac bcgfa ebgacf gcdea
bacgfd dabec ebdgc fgcbade fdeg fbgdec dg begcf dcg cafgbe | gaefbdc dcbae fedbgc acebd
bdcgf aedbgc befa gcfeb fgebac efagc eb efagcd efdgbac egb | gfabce acfged egdafc ecfag
fade facbged defcb fe gdbace fgbcd cagbef bceafd feb edcba | ef cdbea fbe becdf
edcag gaefd edcf cfegad egdbafc cfaegb aec bdcag ce gbefad | bdfgae abcgd cae cdbgaef
cegbf ebfca gbc gc debagf cdgbef becagdf bfdge dabceg gcdf | ebfca cegbf ecbaf eafbc
dgafe gbcdef efcdab bcga eafcdgb cefgba abe gcefb ba egbaf | gaefbc cfagbe fcbeg cedgbf
befgac bed dfcabe db fcgeb gfeda decafbg egcbdf bfdge cbdg | eafdg agfceb febagc gbefd
cdbfgae gcdfea agb gbfad dgfcb faegd ebda eabgfc ba bdgaef | gdfab cbaefg bdgaf fbgeac
cabgd cbfagd fd gecbda fceadgb fgadbe fgdc ebcfa cbdfa dfa | gefabd fd cadfb gcbdea
efga gfbce abgce cbgead cagbdf egdfcab bafecg bfecd fg gbf | fcebd geacb gadfcb fbcgae
efg eagfd gcea bafgecd gdfebc bdaef cdafgb afgdec dgafc eg | eafdb dafbcg cadfg caeg
ebcgad dbe efcgd caegb cgbefda dagb fabdce ebcdg cebagf bd | cfbaeg defgc fgced becfga
bcadge fbedg aegc dbfcag ebgad gdbac gcfdeba ae eba bcdafe | gace agcefdb gbade eba
eabd bfcagde egacd cgebfd ad dcgeba aecfg ebcdg cfdagb acd | dcgbaf cafeg egfac bfcged
ebaf gcdeabf edgba dfacge gfbde fgdcb aecbgd bedgaf edf ef | bdegf ef adgbef dgface
fbedca dgefa adebcgf bacfg efc fgeca fagced ce degc gaebdf | gcfea cfgeda ebfdcga ec
ecba fedcabg bgedf age dcfgae feacgb ae agcfb ebagf cadbgf | fegba efagb afecdg afebg
ea edbgf efadgc bdacfeg bgafe bcafg deba edbcfg debfga fea | fgedba bade gacbf adbe
fdbage cabgfe edb efabg aegd gdecbf fbdae de fabedcg bdcaf | begdfc adefb gfdbce aged
dafcbge febadg cfdea fdgcae ga gaf gcda bfcade egcbf cgeaf | ceagf fcegb afg adefc
adfebc dfgb bg befacg daebf bfegda daegc bdgae gfacbde bag | aedcg gab abgde debag
daegfb dgec aedcfbg fdcgeb bdcef fcadeb beg ge bgfce bcagf | fcgbed dbfega beg febdc
fgcead edgbcf adebf cfb bfacge bcfae cfeag bagc gfcaebd bc | efbad abgc edgabcf acbg
bcafegd eafdg dbfgc edgfc cdgfab geabdc gce ec egfbcd fbce | facbdg badgce dfegc aegfd
bcdafge bedfag cfgbad abgc dgabf dgfcb cb cdb dcefg fabdec | dcb bdfagce cbfgd cdb
afebdc adebc gdbca fbeadcg bacfeg eafd de bcdegf edc abefc | ed cgdab feda efacb
agecfd bgcefd fecba ga egad agbfdc fcaebgd feacg gfedc fga | dega caefb fcgea fcaeb
bfcegad facbgd egbfa ca gcafbe afec cdebg fbeadg bca acgeb | bfgace acgfdb cgedb beafg
cefbad fd befd ecabfg gefacbd bcefa fdeca fad dgaec dbfgca | adf geadc fd dfaec
adfbe becagf geabf ge gacbf efg gfdcea cfbdag ecfbadg becg | fgbae afdcgeb eabdf cgbaf
fgdcae bgdfae cfdag ea egcfa gcbfe becfgda aef ceda dabgfc | gcfaed acdgbef efbgc cade
cgbfde cdb aefcdgb cegda dgbca bafdg fbac badcfg cb gfadbe | dcb bacf cdegfb bfdag
gdcbe bcdega geadc bfgdae fgcad eabc cgefdb gae acfbedg ea | gbdec gcdea befgdc gecda
df abcgdf gfeba bfagdec gbeacd bcaefd abdfg abdcg fdb dcgf | fd fdcg abgdfc gbaedfc
eg eadcf dfabeg cedg aecdfg afgcb cefdba debfcag egf aegfc | fecad fcagbed ecfag cagfb
fbeadc gfa fg fagbd gfdebac eafdgb dacbg fcbeag fedab gefd | agedfb fg eafcdb bgedaf
gbcadf begcfd fcbed caed dafeb eacdbf faebg cdeafgb abd ad | cbefd cfebd cead dab
dceba gbcaed ag gdcbf geab bdaegfc acg acdbg bcfaed afcdeg | gcdbf edbca agcbd cdgba
facbg fdgbca afc fgcade fegbacd af cgbad cgdeba fbda cefgb | fac caf fca cabfg
badecf acbdf efac agedfb bgedc aeb baedc bgcdfa ea fgbcead | face eafc bacfd gacbdf
bc ebfgcd gafbcd dgeacf gfbea bgc dcbe faebgdc ecfgb ecfgd | edbafgc bgefa bcfgde dfcage

@ -0,0 +1 @@
acedgfb cdfbe gcdfa fbcad dab cefabd cdfgeb eafb cagedb ab | cdfeb fcadb cdfeb cdbaf

@ -0,0 +1,88 @@
using Printf
day = 8
function verify(day, task, case, expresult)
taskfun = getfield(Main, Symbol("task$(task-1)"))
filename = "day$(@sprintf "%02d" day)\\data\\case$(@sprintf "%02d" case).txt"
println("Day $day Task $task Case $case")
(result = open(taskfun, filename)) |> display
@assert result == expresult
end
##
function task0(file)
(eachline(file) .|>
(x -> split(x, "|")[2]) .|>
(x -> split(x, " ")) .|>
(x -> sum(map(y -> length(y) [2, 3, 4, 7], x)))) |>
sum
end
##
verify(8, 1, 0, 26)
verify(8, 1, 1, 247)
##
function task1(file)
numbers = map(eachline(file)) do line
mapping = split(split(line, " | ")[1], " ") .|> x -> Set(split(x, ""))
number = split(split(line, " | ")[2], " ") .|> x -> Set(split(x, ""))
local n0, n1, n2, n3, n4, n5, n6, n7, n8, n9
m5 = Set(["a", "b", "c", "d", "e", "f", "g"])
m6 = Set(["a", "b", "c", "d", "e", "f", "g"])
for n in mapping
if length(n) == 2
n1 = n
elseif length(n) == 3
n7 = n
elseif length(n) == 4
n4 = n
elseif length(n) == 5
m5 = intersect(m5, n)
elseif length(n) == 6
m6 = intersect(m6, n)
elseif length(n) == 7
n8 = n
end
end
a = setdiff(n7, n1)
cde = setdiff(n8, m6)
bcef = setdiff(n8, m5)
ce = intersect(cde, bcef)
bf = setdiff(bcef, ce)
d = setdiff(cde, ce)
c = intersect(ce, n1)
e = setdiff(ce, c)
f = intersect(bf, n1)
b = setdiff(bf, f)
g = setdiff(n8, union(a, b, c, d, e, f))
n0 = union(a, b, c, e, f, g)
n2 = union(a, c, d, e, g)
n3 = union(a, c, d, f, g)
n5 = union(a, b, d, f, g)
n6 = union(a, b, d, e, f, g)
n9 = union(a, b, c, d, f, g)
lookup = [n0, n1, n2, n3, n4, n5, n6, n7, n8, n9]
(indexin(number, lookup) .- 1)' * 10 .^ ((length(number)-1):-1:0)
end
sum(numbers)
end
##
verify(8, 2, 0, 61229)
verify(8, 2, 1, 933305)
Loading…
Cancel
Save