Algorisme partició tuts optimitzat

This commit is contained in:
spla 2023-01-29 19:11:28 +01:00
pare e815476da4
commit fd6d792e01

10
post.py
Veure arxiu

@ -25,18 +25,20 @@ class Post:
self.n = post_len / 500 self.n = post_len / 500
ulen = len(self.username)
start = 0 start = 0
end = 488 end = 500 - ulen - 2
i = 0 i = 0
while i < self.n: while i < self.n:
post = f'@{self.username} {self.post[start:end-len(self.username)]}' post = f'@{self.username} {self.post[start:end]}'
self.array.append(post) self.array.append(post)
start = end-len(self.username) start = end
end = end + 488 end = start + (len(post) - ulen - 2)
i += 1 i += 1