This repo houses my solution to the Seneca Systems cave challenge.
The solution script was submitted by the following bash command:
curl -d "{ \"token\": \"5ezbxcT8KATNwcBxwr298j\", \"language\":\"ruby\", \"instructions\": \"The solver script takes 1 argument, path to a file containing the encoded challenge string. Run with: \`ruby ./seneca-challenge.rb path/to/challnges_string\`\", \"script\": \"IyEvdXNyL2Jpbi9lbnYgcnVieQpyZXF1aXJlICJqc29uIgpyZXF1aXJlICJi\nYXNlNjQiCgpjbGFzcyBUaWxlCiAgU1RBUlRfVElMRSA9ID9zCiAgUElDS0FY\nRSA9ID9wCiAgUE9JTlQgPSAvWzEtOV0vCiAgTU9WRVMgPSB7IAogICAgbDog\neyB4OiAtMSwgeTogMCB9LAogICAgcjogeyB4OiAxLCB5OiAwIH0sCiAgICB1\nOiB7IHg6IDAsIHk6IC0xIH0sCiAgICBkOiB7IHg6IDAsIHk6IDEgfQogIH0K\nICBhdHRyX3JlYWRlciA6eCwgOnksIDptb3ZlCiAgCiAgZGVmIGluaXRpYWxp\nemUoeCwgeSwgZmFjZTogU1RBUlRfVElMRSwgbW92ZTogbmlsKQogICAgQHgs\nIEB5ID0geCwgeQogICAgQGZhY2UsIEBtb3ZlID0gZmFjZSwgbW92ZQogIGVu\nZAoKICBkZWYgc2NvcmUKICAgIEBmYWNlID1+IFBPSU5UID8gQGZhY2UudG9f\naSA6IDAKICBlbmQKCiAgZGVmIHJlYWNoYWJsZV9uZWlnaGJvcnMoZ3JpZCwg\ndywgaCwgdmlzaXRlZCA9IFtdKQogICAgTU9WRVMubWFwIGRvIHwobW92ZSwg\nb2Zmc2V0cyl8CiAgICAgIHgyLCB5MiA9IHggKyBvZmZzZXRzWzp4XSwgeSAr\nIG9mZnNldHNbOnldCiAgICAgIG5leHQgaWYgY29sbGlzaW9uPyB4MiwgeTIs\nIHcsIGgsIHZpc2l0ZWQKICAgICAgVGlsZS5uZXcgeDIsIHkyLCBmYWNlOiBn\ncmlkW3kyXVt4Ml0sIG1vdmU6IG1vdmUKICAgIGVu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CiAgZGVmIHN1bV9zY29yZXMK\nICAgIEBzb2x1dGlvbnMuaW5qZWN0KDApIHsgfGEsIHN8IGEgKyBzWzpzY29y\nZV0gfQogIGVuZAoKICBkZWYgbGlzdF9zb2x1dGlvbnMKICAgIEBzb2x1dGlv\nbnMubWFwe3xzfHNbOm1vdmVzXX0uam9pbigiLCIpCiAgZW5kCgogIGRlZiBw\nYXJzZV9sYXlvdXQobGF5b3V0KQogICAgbGF5b3V0LnNwbGl0KD8sKS5tYXAg\nJjpjaGFycwogIGVuZAplbmQKCmlmICQwID09IF9fRklMRV9fCiAgU1RERVJS\nLnB1dHMgIm1pc3NpbmcgYXJndW1lbnQgRklMRU5BTUUiIGFuZCBleGl0IDEg\naWYgQVJHVlswXS5uaWw/CiAgZW5jb2RlZCA9IEZpbGUucmVhZCBBUkdWWzBd\nCiAgY2hhbGxlbmdlcyA9IEpTT04ucGFyc2UgQmFzZTY0LmRlY29kZTY0ICIj\ne2VuY29kZWR9IgogIHB1dHMgU3BlbHVua2VyLm5ldy5zb2x2ZSBjaGFsbGVu\nZ2VzCmVuZA==\n\", \"solution\": \"dlluurrul,drdldrrruu,rrrrrrrruluulldr,lulldldldldllluullllulul,ddddrurrurrrrrdldlldrddrurrddllld,rruuldllluurulurrurrullulullulllluulldldll,ulluurrulluuuululldddrurddlllulullurrrullulldldllululdlddldllluululllddlllullddr,luuluurrdrrrull,uurrrulllulluurrullulullllllulldlullddlllldlulldllldllldll,dldlluluuuuruurrddrrdrrruruuuuurrrurrrdlddldlldluurul,ruulululuulldldrdlldldrdrrdlldluu,lddrrrddrddlddrurrrrrurruuuurrrdddrrddlldlullldldllllllldldldldddldlluuurrulllllluluulullldrdrrdlldllluullluldlluuulluldlldllddllllllululdllllu,urrrrrrururrrururrdrdllldllldlddlldlddrrrrurrruurrrururrurru,rdrdlllulldldlululuulullldlllluuurrdldrruurrullurrrrrruululdldlllllllllllddldllldllluururdrrrululuuurullullulllldluulluluurrdrdrrrurrdldlll,ulllllluulldllulllldldldlllllldlllulllululdluuuruulurrrdrrurdddllldrrrdruruluurrulullllulllluuuuuurruulluuruuluuruluurrrddldrrdlddrddrdllull,rruruuldlluldlulluluuruuululddrdllluuldllulddddrurrdddlldrdldllllulllldlllullullururruurruulluuluurrdrdldrrrdldrrrrruuuluulllurrrurdrdldrrdldrdddldllur\" }" http://seneca-mining-challenge.herokuapp.com/attempts/finish