Created
May 12, 2020 13:33
-
-
Save parastuffs/caee5728aeb05d294e6a9417dfc6ab21 to your computer and use it in GitHub Desktop.
Print order for a book
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOTAL_PAGES = 292 | |
leaflets = 73 | |
n = 4 # pages per sheet | |
l = 5 # sheets per leaflet | |
firstPage = 197 | |
order = list() | |
i = 0 | |
a = b = c = d = 0 | |
while i < l: | |
if i == 0: | |
# Init | |
a = firstPage | |
b = a + 1 | |
d = a + n*l - 1 | |
c = d - 1 | |
else: | |
a = b + 1 | |
b = a + 1 | |
d = c - 1 | |
c = d - 1 | |
order.append(b) | |
order.append(c) | |
order.append(d) | |
order.append(a) | |
i += 1 | |
print(order) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment