python - Editing a specific line of a large file -


i creating pruning tables rubik's cube solver, , means need create file mapping unique identifier cube number in range 0 25 represents distance cube solved state (25 maximum depth using). however, identifiers can go 0 4.7 * 10^21, or 2^72, cannot used indexes in conventional data structure because outside bounds of integer. also, pruning table need checked millions of times, need lookups quick.

so, idea create file id of cube used line number , depth stored there. convert depth base 26 each line of file hold 1 character z. but, need write character specific line of file , i'd prefer not t read thousands of lines before it. so, wondering if there way edit specific line of file if know every line contains 1 character.

for example, id of solved cube 591305913000000, 591305913000000th line store 0, because 0 moves solved cube. id of cube move r performed on has id 5889210210000498 , 1 stored @ 5889210210000498th line.

i open suggestions on better way store of data in way can read. thank in advance help.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -