markruff

optimised chainer

Jul 7th, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. counter = 0
  2. key = ""
  3. masterkey = ""
  4. while True:
  5.   for word in file.readline().strip().split(" "):
  6.     counter = counter +1
  7.     if counter == 1:
  8.       key = word
  9.     elif counter < chainlen:
  10.       key = key + " " + word
  11.     elif counter == chainlen:
  12.       key = key + " " + word
  13.       masterkey = key
  14.     else: # counter exceeded
  15.       # put code here to read in chaintable (optimised, but code size increased)  
  16.   if counter >= chainlen:
  17.     break
Add Comment
Please, Sign In to add comment