Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- def func1(Pos1, Pos2, Length):
- Delta = Pos2 - Pos1;
- j = Pos2;
- p1 = Pos1;
- p2 = Pos2;
- Step = 0;
- SubStep = 0;
- while (Step < Delta + Length):
- Step = Step + 1;
- SubStep = SubStep + 1;
- print(" %d → Buffer"%j);
- print(" %d → %d"%(p1,j));
- while 1:
- Step = Step + 1;
- if (j + Delta < Pos2 + Length):
- j = j + Delta;
- else:
- j = j - Length;
- print(" Buffer ↔ %d"%(j));
- if (j == p1):
- p1 = p1 + 1;
- p2 = p2 + 1;
- j = p2;
- break;
- return SubStep;
Advertisement
Add Comment
Please, Sign In to add comment