Yeah, not to worry, the current script represents just a very few evening hours of quick-and-dirty experimental work. There are comments recording all the places where I temporarily edited the README text to make a welded variant work -- the "b" suffixes stand for "base". You're right that that's a lousy long-term solution.
I expect to get a script working on an unmodified README file eventually -- probably copying guns from fixed or variable or confirmed folders where they're available, or from a fourth "custom" folder where they're not, so that the script's target directory ends up with a complete collection.
I don't think I'll attempt the red-marked weld trick. Of the cases I've run into so far, that's a little too simple to work -- you often have to subtract a cell as well as adding cells. I'm vaguely considering a lookup table of XOR patch patterns. It's such a pain to build the tools to make a system like that easy to use, though, especially for People Who Didn't Invent The System... I'll probably just throw all the exceptions into the "custom" folder, and check there first before building each new gun.
Similarly, the pX_0 gun can presumably always be copied straight from the variable folder. So one weld is adequately recorded already. It's really only a few tough cases that will go in the "custom" folder -- where there's a deep enough weld that a different weld is needed at pX_1, or where I get bored trying to find the right algorithm to adjust the x_trips / y_trips guns.
I added your debug code in, but it made the script much more annoying to run. In this version, all the warnings are saved until the end. Will patch all the other problems... later. Maybe. Want to get it building more guns first to make sure I know what all the problems are.
Fixed all problems causing errors or warnings. Script now generates 177 guns.
Code: Select all
# TODO: use unmodified README
# TODO: create a "custom" folder, check there before building
# TODO: copy pX_0 guns straight from variable folder
# TODO: copy fixed guns from fixed folder, test if possible
# (find the glider by locating the cell that leaves the bounding box at T=1)
# DONE: fixed orientation of p358, p363, and overtrimming problem in the p392s
import golly as g
import os
outfolder = r"C:\Users\Dave\Desktop\guns"
# r"C:\Users\greedd\Desktop\g\test"
g.addlayer()
baseguns = dict()
# 89 (3127, 'p00356_0')
# 178 (3127, 'p00356_0')
# 356 (3127, 'p00356_0')
baseguns["p00356b"]=[g.parse("""31.2C$30.C.C$24.2C4.C$22.C2.C2.2C.4C$22.2C.C.C.C.C2.C$25.C.C.C.C$25.C
.C.2C$26.C2$39.2C$30.2C7.C$30.2C5.C.C$37.2C2$9.C$9.3C$12.C$11.2C40.A$
47.2A3.A.A$27.2C19.A3.A2.A$3.2C23.C19.A.2A.A.A$3.C21.3C21.A.A.A.2A$2C
.C21.C26.2A.A2.A$C2.3C4.2C45.2A$.2C3.C3.2C$3.4C$3.C15.2C14.2A5.2E$4.
3C12.C.C2.2A10.A5.E.E$7.C13.C2.A11.A.A3.E$2.5C14.2CA2.A10.2A16.2A$2.C
21.3A28.2A$4.C18.A$3.2C18.2A$8.2A$9.A45.2A$9.A.2A42.2A$10.A2.A$11.2A$
26.2A$26.2A2$55.A$54.A.A$35.A3.2A14.A$34.A.A3.A$33.A.A3.A$29.2A.A.A3.
A$29.2A.A2.4A.A4.2A$33.A.A3.2A3.A.A$29.2A.2A.A.A6.A$30.A.A3.A.3A2.2A
11.D$18.2A10.A.A4.A2.A16.D$18.2A11.A6.2A15.3D!"""),0,0,0]
baseguns["p00356"]=[g.parse("""31.2C$30.C.C$24.2C4.C$22.C2.C2.2C.4C$22.2C.C.C.C.C2.C$25.C.C.C.C$25.C
.C.2C$26.C2$39.2C$30.2C7.C$30.2C5.C.C$37.2C2$9.C$9.3C$12.C$11.2C40.A$
47.2A3.A.A$27.2C19.A3.A2.A$3.2C23.C19.A.2A.A.A$3.C21.3C21.A.A.A.2A$2C
.C21.C26.2A.A2.A$C2.3C4.2C45.2A$.2C3.C3.2C$3.4C$3.C15.2C14.2A5.2E$4.
3C12.C.C14.A5.E.E$7.C13.C14.A.A3.E$2.5C14.2C3.A10.2A16.2A$2.C21.3A28.
2A$4.C18.A$3.2C18.2A$8.2A$9.A45.2A$9.A.2A42.2A$10.A2.A$11.2A$26.2A$
26.2A2$55.A$54.A.A$35.A3.2A14.A$34.A.A3.A$33.A.A3.A$29.2A.A.A3.A$29.
2A.A2.4A.A4.2A$33.A.A3.2A3.A.A$29.2A.2A.A.A6.A$30.A.A3.A.3A2.2A11.D$
18.2A10.A.A4.A2.A16.D$18.2A11.A6.2A15.3D!"""),-1,-1,0]
baseguns["p00358"]=[g.parse("""18.2C14.A$18.2C14.3A$37.A$36.A.A$36.A.A$37.A5$3.2C47.2A$3.2C47.2A4$
32.2A$31.A.A$31.A$3.2C25.2A7.2A$2.C2.C2.2C29.2A$3.2C2.C.C$5.2C16.2C
22.2A.A$5.C17.C23.2A.3A$2.2C.C2.C15.3C26.A$2.C.2C.C.C16.C20.2A.3A$6.C
.C37.A2.2A$3.2C2.C37.A.A$.3C.2C20.A16.A.A.2A.A$C26.3A15.A2.A.2A$.3C.
2C23.A17.A$3.C.2C22.2A16.2A$44.A.A2.2A$13.2C29.2A2.A2.A$13.2C7.2C25.
2A$22.C$20.C.C$13.3E4.2C28.2A$13.E36.A$14.E33.A.A$48.2A$2C$2C5$16.C$
15.C.C$15.C.C$16.C36.D$17.3C14.2A15.D.D$19.C14.2A16.2D!"""),-1,-1,0]
baseguns["p00358x2"]=[g.parse("""21.2C11.C$21.2C10.C.C$33.C.C2.2C3.C$32.2C.2C2.C2.C.C6.2C$36.C.C3.C.C
6.2C$32.2C.C2.4C.C$32.2C.C.C3.C$36.C.C3.C$37.C.C3.C$38.C3.2C4$25.2E2.
2C$24.E.E2.2C$14.2C10.E$13.C2.C$12.C.2C$12.C48.2C$11.2C48.2C$26.2C$
20.A5.C$19.A.A5.3C$18.A2.A7.C10.2C$19.A19.C.C$39.C$14.2A22.2C$13.A2.A
17.2A$14.A.A17.A$15.A16.A.A$17.3A12.2A10.A$18.2A24.3A$47.A$46.2A$11.
2A48.2A$11.2A48.A$58.2A.A$57.A2.A$58.2A$43.2A$43.2A$12.2A$12.2A2$30.
2A3.A$3.2A25.A3.A.A$3.A.A25.A3.A.A$4.A27.A3.A.A.2A$23.2A5.A.4A2.A.2A$
23.A5.A.A3.A.A$9.A2.2A10.3A2.A.A2.A2.2A.2A$9.A2.3A11.A3.A3.2A2.A.A$
14.2A22.A.A10.2A$2.2A9.A25.A11.2A$.A.A$.A$2A13.2A$15.A10.D$8.2A6.3A8.
D$8.2A8.A6.3D!"""),1,-1,50]
baseguns["p00358x3"]=[g.parse("""22.2C11.C$22.2C10.C.C$34.C.C2.2C3.C$33.2C.2C2.C2.C.C6.2C$37.C.C3.C.C
6.2C$33.2C.C2.4C.C$33.2C.C.C3.C$37.C.C3.C$38.C.C3.C$39.C3.2C4$26.2E2.
2C$25.E.E2.2C$15.2C10.E$14.C2.C$13.C.2C$13.C48.2C$12.2C48.2C$27.2C$
27.C$28.3C$30.C10.2C$40.C.C$40.C$39.2C$35.2A$35.A$33.A.A$33.2A10.A$
45.3A$48.A$47.2A$12.2A48.2A$12.2A48.A$59.2A.A$58.A2.A$59.2A$11.A32.2A
$11.3A30.2A$14.A$13.2A2$4.2A25.2A3.A$3.A.A25.A3.A.A$3.A11.3A14.A3.A.A
$2A.A10.A3.A14.A3.A.A.2A$.A.A.2A6.A5.A4.2A5.A.4A2.A.2A$.A.A.2A6.A5.A
4.A5.A.A3.A.A$2A.A9.A5.A5.3A2.A.A2.A2.2A.2A$A2.4A7.A3.A2.2A4.A3.A3.2A
2.A.A$.2A3.A8.3A3.A.A15.A.A10.2A$3.2A18.A16.A11.2A$3.A13.D5.2A$5.A12.
D$4.2A10.3D!"""),1,-1,16]
# 121 (3660, 'p00363b_0')
# 363 (3660, 'p00363b_0')
baseguns["p00363b"]=[g.parse("""30.2C$30.C.C$32.C4.2C$28.4C.2C2.C2.C$28.C2.C.C.C.C.2C$31.C.C.C.C$32.
2C.C.C$36.C$41.A$22.2C17.3A$23.C7.2C11.A$23.C.C5.2C10.A.A$24.2C17.A.A
$44.A5$59.2A$34.2C23.2A$34.C$35.3C$37.C$37.A.2A$35.2A.A.A$35.A2.A$37.
2A7.2A$46.2A2$54.2A.A$3.2C49.2A.3A$4.C55.A$2.C51.2A.3A$2.5C14.2C30.A
2.2A$7.C13.C30.A.A$4.3C12.C.C12.A16.A.A.2A.A$3.C15.2C13.3A15.A2.A.2A$
3.4C30.A17.A$.2C3.C3.2C24.2A16.2A$C2.3C4.2C39.A.A2.2A$2C.C47.2A2.A2.A
$3.C52.2A$3.2C2$20.3E34.2A$11.2C7.E36.A$12.C8.E33.A.A$9.3C43.2A$9.C9$
60.D$41.2A15.D.D$41.2A16.2D!"""),0,0,0]
baseguns["p00363"]=[g.parse("""30.2C$30.C.C$32.C4.2C$28.4C.2C2.C2.C$28.C2.C.C.C.C.2C$31.C.C.C.C$32.
2C.C.C$36.C$41.A$22.2C17.3A$23.C7.2C11.A$23.C.C5.2C10.A.A$24.2C17.A.A
$44.A5$59.2A$34.2C23.2A$34.C$35.3C$37.C$39.2A$38.A.A$38.A$37.2A7.2A$
46.2A2$54.2A.A$3.2C49.2A.3A$4.C55.A$2.C51.2A.3A$2.5C14.2C30.A2.2A$7.C
13.C30.A.A$4.3C12.C.C12.A16.A.A.2A.A$3.C15.2C13.3A15.A2.A.2A$3.4C30.A
17.A$.2C3.C3.2C24.2A16.2A$C2.3C4.2C39.A.A2.2A$2C.C47.2A2.A2.A$3.C52.
2A$3.2C2$20.3E34.2A$11.2C7.E36.A$12.C8.E33.A.A$9.3C43.2A$9.C9$60.D$
41.2A15.D.D$41.2A16.2D!"""),-1,-1,0]
# 98 (3894, 'p00392b_0')
# 196 (3894, 'p00392b_0')
# 392 (3894, 'p00392b_0')
baseguns["p00392b"]=[g.parse("""20.2A11.A$20.2A10.A.A$32.A.A2.2A3.A$31.2A.2A2.A2.A.A$35.A.A3.A.A12.A$
31.2A.A2.4A.A11.3A$31.2A.A.A3.A12.A$35.A.A3.A11.2A$36.A.A3.A$37.A3.2A
4$28.2A$28.2A30.2A$13.2A45.2A$12.A2.A$11.A.2A$11.A$10.2A$25.2A$25.A$
26.3A29.2A.A.2A$28.A10.2A17.2A.2A.A$4.C33.A.A$2.5C14.2C15.A$.C5.C13.C
15.2A$.C2.3C12.C.C$2C.C15.2C$C2.4C$.2C3.C3.2C$3.3C4.2C$3.C$2C.C$2C.2C
2$29.C35.A$11.2C16.3C$12.C19.C$9.3C19.2C4.E27.D$9.C27.E.E23.D.D$37.2E
25.2D2$50.A$49.A.A$48.A.A$41.2C3.3A2.3A3.2A$34.2C5.C.C.A3.2A3.A2.2A$
34.2C7.C.A2.A2.2A.A$43.2C3.A.A2.A$47.2A.2A$30.C$29.C.C.2C$29.C.C.C.C$
28.2C.C.C.C2.C$29.C2.2C.4C$29.C4.C$30.3C.C2.2C$32.2C3.2C!"""),0,0,0]
baseguns["p00392"]=[g.parse("""20.2A11.A$20.2A10.A.A$32.A.A2.2A3.A$31.2A.2A2.A2.A.A$35.A.A3.A.A12.A$
31.2A.A2.4A.A11.3A$31.2A.A.A3.A12.A$35.A.A3.A11.2A$36.A.A3.A$37.A3.2A
4$28.2A$28.2A30.2A$13.2A45.2A$12.A2.A$11.A.2A$11.A$10.2A$25.2A$25.A$
26.3A29.2A.A.2A$28.A10.2A17.2A.2A.A$4.C33.A.A$2.5C14.2C15.A$.C5.C13.C
15.2A$.C2.3C12.C.C$2C.C15.2C$C2.4C$.2C3.C3.2C$3.3C4.2C$3.C$2C.C$2C.2C
2$29.C35.A$11.2C16.3C$12.C19.C$9.3C19.2C4.E27.D$9.C27.E.E23.D.D$37.2E
25.2D2$50.A$49.A.A$48.A.A$41.2C3.3A2.3A3.2A$34.2C5.C.C.A3.2A3.A2.2A$
34.2C7.C2.3A2.2A.A$43.2C3.A.A2.A$49.A.A$30.C19.A$29.C.C.2C$29.C.C.C.C
$28.2C.C.C.C2.C$29.C2.2C.4C$29.C4.C$30.3C.C2.2C$32.2C3.2C!"""),-1,1,0]
baseguns["p00418"]=[g.parse("""24.2A11.A$24.2A10.A.A$36.A.A2.2A3.A$35.2A.2A2.A2.A.A$39.A.A3.A.A$35.
2A.A2.4A.A$35.2A.A.A3.A$39.A.A3.A15.2A$40.A.A3.A14.A$41.A3.2A12.A.A$
55.2A2.2A$55.2A2$32.2A$32.2A$17.2A48.2A$16.A2.A47.2A7.2A$15.A.2A57.A$
15.A58.A.A$14.2A58.2A$29.2A$11.2C16.A$11.2C17.3A$32.A10.2A$42.A.A$42.
A$2C39.2A23.A$.C23.2C38.A.A.2A6.D$.C.C21.C37.3A.A.A5.D.D$2.2C19.C.C
36.A3.A4.A4.2D$23.2C10.C27.A2.A.4A$35.3C17.2A7.A.A.A$38.C16.2A8.A3.3A
$37.2C32.A$52.2C$52.C$49.2C.C$48.C2.C$38.E10.2C$34.2C2.E.E$34.2C2.2E
2$11.2C$7.2C2.2C$6.C.C12.2C3.C$6.C14.C3.C.C$5.2C15.C3.C.C$23.C3.C.C.
2C$21.C.4C2.C.2C$20.C.C3.C.C$20.C.C2.C2.2C.2C$21.C3.2C2.C.C$29.C.C10.
2C$30.C11.2C!"""),-1,1,4]
# 443 (3498, 'p00443b_0')
baseguns["p00443b"]=[g.parse("""28.C11.2C$27.C.C10.2C$19.C3.2C2.C.C$18.C.C2.C2.2C.2C$18.C.C3.C.C$19.C
.4C2.C.2C$21.C3.C.C.2C$3.2C15.C3.C.C$4.C14.C3.C.C$4.C.C12.2C3.C$5.2C
2.2C$9.2C2$32.2C$32.2C$47.2C$46.C2.C$47.2C.C9.A$50.C3.2A3.A.A$50.2C3.
A3.A2.A$35.2C18.A.2A.A.A$2C34.C19.A.A.A.2A$.C31.3C23.2A.A2.A$.C.C17.
2C10.C30.2A$2.2C17.C.C$23.C$23.2C17.2A5.2E$43.A5.E.E$43.A.A3.E$33.A
10.2A16.2A$2.2C27.3A28.2A$.C.C26.A$.C15.A12.2A$2C14.A.A$11.2C2.A2.A
43.2A$11.C3.2A.2A42.2A$12.3C2.A2.A$15.C2.2A$14.C18.2A$14.2C17.2A2$62.
A$61.A.A$42.A3.2A14.A$41.A.A3.A$40.A.A3.A$36.2A.A.A3.A$36.2A.A2.4A.A
4.2A$40.A.A3.2A3.A.A$36.2A.2A.A.A6.A$37.A.A3.A.3A2.2A11.D$25.2A10.A.A
4.A2.A16.D$25.2A11.A6.2A15.3D!"""),0,0,0]
baseguns["p00443"]=[g.parse("""28.C11.2C$27.C.C10.2C$19.C3.2C2.C.C$18.C.C2.C2.2C.2C$18.C.C3.C.C$19.C
.4C2.C.2C$21.C3.C.C.2C$3.2C15.C3.C.C$4.C14.C3.C.C$4.C.C12.2C3.C$5.2C
2.2C$9.2C2$32.2C$32.2C$47.2C$46.C2.C$47.2C.C9.A$50.C3.2A3.A.A$50.2C3.
A3.A2.A$35.2C18.A.2A.A.A$2C34.C19.A.A.A.2A$.C31.3C23.2A.A2.A$.C.C17.
2C10.C30.2A$2.2C17.C.C$23.C$23.2C17.2A5.2E$43.A5.E.E$43.A.A3.E$33.A
10.2A16.2A$2.2C27.3A28.2A$.C.C26.A$.C28.2A$2C13.2A$11.2C3.A45.2A$11.C
4.A.2A42.2A$12.3C2.A2.A$14.C3.2A$33.2A$33.2A2$62.A$61.A.A$42.A3.2A14.
A$41.A.A3.A$40.A.A3.A$36.2A.A.A3.A$36.2A.A2.4A.A4.2A$40.A.A3.2A3.A.A$
36.2A.2A.A.A6.A$37.A.A3.A.3A2.2A11.D$25.2A10.A.A4.A2.A16.D$25.2A11.A
6.2A15.3D!"""),-1,-1,0]
# 112 (3213, 'p00448b_0')
# 224 (3213, 'p00448b_0')
# 448 (3213, 'p00448b_0')
baseguns["p00448b"]=[g.parse("""19.2C6.C11.2C$18.C2.C4.C.C10.2C$9.2C7.3C.C3.C.C$9.2C10.C.C.2C.2C$18.
2C3.C.C$18.C.4C2.C.2C$20.C3.C.C.2C$19.C3.C.C$18.C3.C.C$18.2C3.C4$31.
2C$31.2C17.2A.A$46.2C2.A.2A$45.C2.C.A3.2A3.2A$2.2C42.2C.C.2A3.A2.A$2.
2C45.C2.A.2A.A.A$49.2C2.A.A.A.2A$34.2C20.2A.A2.A$35.C25.2A$2.2C28.3C$
2.2C16.2C10.C$20.C.C16.2A5.2E$22.C17.A5.E.E$22.2C16.A.A3.E$30.A10.2A
16.2A$28.3A28.2A$2C25.A$C2.C.2C20.2A$2.2C.C.C.C2.2A$3.C.C.2C.C2.A45.
2A$3.C2.C3.2C.A.2A42.2A$2.2C3.2C3.C.A2.A$9.2C.C2.2A$9.C.2C17.2A$30.2A
2$59.A$58.A.A$39.A3.2A14.A$38.A.A3.A$37.A.A3.A$33.2A.A.A3.A$33.2A.A2.
4A.A4.2A$37.A.A3.2A3.A.A$33.2A.2A.A.A6.A$34.A.A3.A.3A2.2A11.D$22.2A
10.A.A4.A2.A16.D$22.2A11.A6.2A15.3D!"""),-1,-1,0]
baseguns["p00448"]=[g.parse("""19.2C6.C11.2C$18.C2.C4.C.C10.2C$9.2C7.3C.C3.C.C$9.2C10.C.C.2C.2C$18.
2C3.C.C$18.C.4C2.C.2C$20.C3.C.C.2C$19.C3.C.C$18.C3.C.C$18.2C3.C4$31.
2C$31.2C$46.2C9.A$45.C2.C2.2A3.A.A$2.2C42.2C.C2.A3.A2.A$2.2C45.C2.A.
2A.A.A$49.2C2.A.A.A.2A$34.2C20.2A.A2.A$35.C25.2A$2.2C28.3C$2.2C16.2C
10.C$20.C.C16.2A5.2E$22.C17.A5.E.E$22.2C16.A.A3.E$30.A10.2A16.2A$28.
3A28.2A$2C25.A$C2.C.2C20.2A$2.2C.C.C.C2.2A$3.C.C.2C.C2.A45.2A$3.C2.C
3.C2.A.2A42.2A$4.C.C3.2C2.A2.A$5.C9.2A$30.2A$30.2A2$59.A$58.A.A$39.A
3.2A14.A$38.A.A3.A$37.A.A3.A$33.2A.A.A3.A$33.2A.A2.4A.A4.2A$37.A.A3.
2A3.A.A$33.2A.2A.A.A6.A$34.A.A3.A.3A2.2A11.D$22.2A10.A.A4.A2.A16.D$
22.2A11.A6.2A15.3D!"""),-1,-1,0]
baseguns["p00448bx3"]=[g.parse("""57.A2.2A$57.4A.A$62.A$55.7A.2A$54.A6.A.A2.A$54.2A2.2A.A3.2A$58.2A.2A
3$58.2A$58.2A.2A$49.2A6.2A.A$50.A$50.A.A$51.2A$22.2A11.A6.2A$22.2A10.
A.A4.A2.A21.D$34.A.A3.A.3A2.2A15.D.D$33.2A.2A.A.A6.A16.2D$37.A.A3.2A
3.A.A$33.2A.A2.4A.A4.2A$33.2A.A.A3.A18.2A$37.A.A3.A17.A$38.A.A3.A17.
3A$39.A3.2A14.A4.A$58.A.A$59.A2$30.2A$9.C.2C17.2A$9.2C.C2.2A$2.2C3.2C
3.C.A2.A$3.C2.C3.2C.A.2A42.2A$3.C.C.2C.C2.A45.2A$2.2C.C.C.C2.2A$C2.C.
2C20.2A$2C25.A$28.3A28.2A$30.A10.2A16.2A$22.2C16.A.A$22.C17.A$20.C.C
16.2A$2.2C16.2C10.C$2.2C28.3C$35.C25.2A$34.2C4.E15.2A.A2.A$39.E9.2C2.
A.A.A.2A$2.2C35.3E7.C2.A.2A.A.A$2.2C42.2C.C.2A3.A2.A$45.C2.C.A3.2A3.
2A$46.2C2.A.2A$31.2C17.2A.A$31.2C4$18.2C3.C$18.C3.C.C$19.C3.C.C$20.C
3.C.C.2C$18.C.4C2.C.2C$18.2C3.C.C$9.2C10.C.C.2C.2C$9.2C7.3C.C3.C.C$
18.C2.C4.C.C10.2C$19.2C6.C11.2C!"""),-1,1,0]
baseguns["p00448x3"]=[g.parse("""57.A2.2A$57.4A.A$62.A$55.7A.2A$54.A6.A.A2.A$54.2A2.2A.A3.2A$58.2A.2A
4$61.A$49.2A9.A.A$50.A9.A.A$50.A.A8.A$51.2A$22.2A11.A6.2A$22.2A10.A.A
4.A2.A21.D$34.A.A3.A.3A2.2A15.D.D$33.2A.2A.A.A6.A16.2D$37.A.A3.2A3.A.
A$33.2A.A2.4A.A4.2A$33.2A.A.A3.A18.2A$37.A.A3.A17.A$38.A.A3.A17.3A$
39.A3.2A14.A4.A$58.A.A$59.A2$30.2A$30.2A$5.C9.2A$4.C.C3.2C2.A2.A$3.C
2.C3.C2.A.2A42.2A$3.C.C.2C.C2.A45.2A$2.2C.C.C.C2.2A$C2.C.2C20.2A$2C
25.A$28.3A28.2A$30.A10.2A16.2A$22.2C16.A.A$22.C17.A$20.C.C16.2A$2.2C
16.2C10.C$2.2C28.3C$35.C25.2A$34.2C4.E15.2A.A2.A$39.E9.2C2.A.A.A.2A$
2.2C35.3E7.C2.A.2A.A.A$2.2C42.2C.C2.A3.A2.A$45.C2.C2.2A3.A.A$46.2C9.A
$31.2C$31.2C4$18.2C3.C$18.C3.C.C$19.C3.C.C$20.C3.C.C.2C$18.C.4C2.C.2C
$18.2C3.C.C$9.2C10.C.C.2C.2C$9.2C7.3C.C3.C.C$18.C2.C4.C.C10.2C$19.2C
6.C11.2C!"""),-1,1,0]
baseguns["p00463"]=[g.parse("""41.C11.2C$40.C.C10.2C$32.C3.2C2.C.C$31.C.C2.C2.2C.2C$17.2C12.C.C3.C.C
$18.C13.C.4C2.C.2C$18.C.C13.C3.C.C.2C$19.2C12.C3.C.C$32.C3.C.C$32.2C
3.C$5.2C$5.2C2$45.2C2.2E$45.2C2.E.E$49.E10.2C$59.C2.C$2C58.2C.C$2C61.
C$63.2C$48.2C$49.C$20.2C24.3C$20.2C11.2C11.C$33.C$34.3C$36.C$40.2A$
41.A$41.A.A$31.A10.2A$29.3A$28.A$28.2A$13.2A48.2A$14.A48.2A$14.A.2A$
15.A2.A$16.2A$31.2A$31.2A4$40.A3.2A$39.A.A3.A$38.A.A3.A$34.2A.A.A3.A$
34.2A.A2.4A.A5.2A$38.A.A3.A.A5.A$34.2A.2A2.A2.A.A2.3A$35.A.A2.2A3.A3.
A13.D$23.2A10.A.A26.D$23.2A11.A25.3D!"""),-1,-1,0]
baseguns["p00463x3"]=[g.parse("""28.C11.2C$27.C.C10.2C$19.C3.2C2.C.C$10.2C6.C.C2.C2.2C.2C$10.2C6.C.C3.
C.C$19.C.4C2.C.2C36.A2.2A$21.C3.C.C.2C36.4A.A$20.C3.C.C45.A$19.C3.C.C
39.7A.2A$19.2C3.C39.A6.A.A2.A$64.2A2.2A.A3.2A$68.2A.2A2$32.2C2.2E$32.
2C2.E.E$36.E10.2C22.A$46.C2.C9.2A9.A.A$47.2C.C9.A9.A.A$2C48.C9.A.A8.A
$2C48.2C9.2A$35.2C$36.C39.D$33.3C38.D.D$21.2C10.C41.2D$21.C.C$23.C$
23.2C46.2A$28.A42.A$28.3A41.3A$31.A42.A$18.A11.2A11.2A25.A$16.3A24.2A
24.A.A$15.A53.A.A$15.2A51.2A.2A$2A62.2A$.A62.A.A$.A.2A61.A$2.A2.A59.A
3.A$3.2A61.4A$18.2A34.2A$18.2A33.A.A12.2A$53.A14.2A$52.2A2$27.A3.2A$
26.A.A3.A$25.A.A3.A12.2A$21.2A.A.A3.A13.A.A$21.2A.A2.4A.A13.A$25.A.A
3.A.A12.2A$21.2A.2A2.A2.A.A$22.A.A2.2A3.A$10.2A10.A.A$10.2A11.A!"""),-1,-1,3]
'''
baseguns["p00463"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00482"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00482x3"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00564"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00571"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00652"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00683"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00686"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00721"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00827"]=[g.parse("""
"""),-1,-1,0]
baseguns["p00865"]=[g.parse("""
"""),-1,-1,0]
'''
readme = """14 (61805, 'fixed')
15 (4004, 'fixed')
16 (31152, 'fixed')
17 (40205, 'fixed')
18 (21762, 'fixed')
19 (36019, 'fixed')
20 (2800, 'fixed')
21 (28600, 'fixed')
22 (1125, 'fixed')
23 (2312, 'fixed')
24 (1376, 'fixed')
25 (15762, 'fixed')
26 (17667, 'fixed')
27 (22794, 'fixed')
28 (20406, 'fixed')
29 (21659, 'fixed')
30 (324, 'fixed')
31 (15312, 'fixed')
32 (14763, 'fixed')
33 (16006, 'fixed')
34 (14430, 'fixed')
35 (16950, 'fixed')
36 (2450, 'fixed')
37 (9075, 'fixed')
38 (16016, 'fixed')
39 (7320, 'fixed')
40 (2940, 'fixed')
41 (10416, 'fixed')
42 (7345, 'fixed')
43 (11136, 'fixed')
44 (1218, 'fixed')
45 (1920, 'fixed')
46 (784, 'fixed')
47 (4248, 'fixed')
48 (1927, 'fixed')
49 (8892, 'fixed')
50 (3276, 'fixed')
51 (7980, 'fixed')
52 (5130, 'fixed')
53 (9856, 'fixed')
54 (8614, 'fixed')
55 (7980, 'fixed')
56 (7497, 'fixed')
57 (7503, 'fixed')
58 (9900, 'fixed')
59 (10250, 'fixed')
60 (1053, 'fixed')
61 (10332, 'fixed')
62 (10824, 'fixed')
63 (8436, 'fixed')
64 (4355, 'fixed')
65 (8976, 'fixed')
66 (2295, 'fixed')
67 (4968, 'fixed')
68 (7080, 'fixed')
69 (5390, 'fixed')
70 (7812, 'fixed')
71 (10830, 'fixed')
72 (1440, 'fixed')
73 (11128, 'fixed')
74 (3630, 'fixed')
75 (4756, 'fixed')
76 (7930, 'fixed')
77 (7254, 'fixed')
78 (3248, 'p00358_4')
79 (4160, 'p00363_4')
80 (3685, 'p00448_4')
81 (3953, 'p00405osc9_0')
82 (4392, 'p00436_7')
83 (4316, 'p00482_2')
84 (4060, 'p00448_7')
85 (3953, 'p00385osc5_5')
86 (3843, 'p00358_9')
87 (3927, 'fixed')
88 (1512, 'fixed')
89 (3127, 'p00356b_0')
90 (1110, 'fixed')
91 (3240, 'p00356_1')
92 (1320, 'fixed')
93 (3355, 'p00356_2')
94 (950, 'fixed')
95 (3472, 'p00356_3')
96 (3520, 'fixed')
97 (3591, 'p00356_4')
98 (3894, 'p00392b_0')
99 (3712, 'p00356_5')
100 (4020, 'p00392_1')
101 (3835, 'p00356_6')
102 (4148, 'p00392_2')
103 (3960, 'p00356_7')
104 (861, 'fixed')
105 (4087, 'p00356_8')
106 (4410, 'p00392_4')
107 (4216, 'p00356_9')
108 (4544, 'p00392_5')
109 (3510, 'p00436_0')
110 (2600, 'fixed')
111 (3630, 'p00436_1')
112 (3213, 'p00448b_0')
113 (3752, 'p00436_2')
114 (3328, 'p00448_1')
115 (3876, 'p00436_3')
116 (3445, 'p00448_2')
117 (4002, 'p00436_4')
118 (3564, 'p00448_3')
119 (4130, 'p00436_5')
120 (726, 'fixed')
121 (3660, 'p00363b_0')
122 (2915, 'p00358_1')
123 (3286, 'fixed')
124 (3355, 'p00356_2')
125 (4526, 'p00436_8')
126 (4060, 'p00448_7')
127 (4662, 'p00436_9')
128 (3844, 'p00368osc4_2')
129 (4032, 'p00363_3')
130 (3248, 'p00358_4')
131 (4758, 'p00345_6')
132 (1849, 'fixed')
133 (5082, 'p00436_12')
134 (4588, 'p00448_11')
135 (2205, 'fixed')
136 (4148, 'p00392_2')
137 (4422, 'p00363_6')
138 (1683, 'fixed')
139 (5184, 'p00345_9')
140 (4087, 'p00356_8')
141 (4248, 'fixed')
142 (4345, 'p00418_1')
143 (4189, 'fixed')
144 (1155, 'fixed')
145 (4720, 'p00564_2_p00145')
146 (3968, 'p00358_10')
147 (4071, 'fixed')
148 (3630, 'p00436_1')
149 (4838, 'p00564_4_p00149')
150 (1575, 'fixed')
151 (4897, 'p00564_5_p00151')
152 (3328, 'p00448_1')
153 (3740, 'p00443_2')
154 (4340, 'fixed')
155 (4026, 'p00465osc5_0')
156 (1764, 'fixed')
157 (5074, 'p00564_8_p00157')
158 (5040, 'fixed')
159 (5133, 'p00564_9_p00159')
160 (3685, 'p00448_4')
161 (3685, 'p00483osc7_0')
162 (4661, 'p00405osc9x2_0')
163 (5278, 'p00652_0_p00163')
164 (4392, 'p00436_7')
165 (5256, 'p00455osc5_5')
166 (4316, 'p00482_2')
167 (5082, 'fixed')
168 (4060, 'p00448_7')
169 (4514, 'p00443_8')
170 (5183, 'p00358_19')
171 (4891, 'p00513osc9_0')
172 (4800, 'p00436_10')
173 (5568, 'p00652_5_p00173')
174 (4588, 'fixed')
175 (3816, 'p00350osc5_0')
176 (2024, 'fixed')
177 (4928, 'p00443_11')
178 (3127, 'p00356b_0')
179 (2808, 'p00358_0')
180 (1320, 'fixed')
181 (5800, 'p00652_9_p00181')
182 (3240, 'p00356_1')
183 (2915, 'p00358_1')
184 (1085, 'fixed')
185 (4800, 'p00515osc5_5')
186 (3355, 'p00356_2')
187 (3024, 'p00358_2')
188 (1586, 'fixed')
189 (5183, 'p00567osc7_0')
190 (3472, 'p00356_3')
191 (3135, 'p00358_3')
192 (3588, 'fixed')
193 (5220, 'p00571_1_p00193')
194 (3591, 'p00356_4')
195 (3248, 'p00358_4')
196 (3894, 'p00392b_0')
197 (5460, 'p00559_4')
198 (2964, 'fixed')
199 (3363, 'p00358_5')
200 (3763, 'fixed')
201 (5400, 'p00571_4_p00201')
202 (3835, 'p00356_6')
203 (3480, 'p00358_6')
204 (3965, 'p00408osc6_0')
205 (5175, 'p00410osc5_0')
206 (3960, 'p00356_7')
207 (3599, 'p00358_7')
208 (1394, 'fixed')
209 (4212, 'p00418_0')
210 (1375, 'fixed')
211 (3720, 'p00358_8')
212 (4410, 'p00392_4')
213 (4345, 'p00418_1')
214 (4216, 'p00356_9')
215 (3843, 'p00358_9')
216 (2193, 'fixed')
217 (4480, 'p00418_2')
218 (3510, 'p00436_0')
219 (3968, 'p00358_10')
220 (2610, 'fixed')
221 (4617, 'p00418_3')
222 (3630, 'p00436_1')
223 (4095, 'p00358_11')
224 (3213, 'p00448b_0')
225 (4640, 'fixed')
226 (3752, 'p00436_2')
227 (4224, 'p00358_12')
228 (3328, 'p00448_1')
229 (4897, 'p00418_5')
230 (2336, 'fixed')
231 (4355, 'p00358_13')
232 (3445, 'p00448_2')
233 (5040, 'p00418_6')
234 (3726, 'fixed')
235 (4488, 'p00358_14')
236 (3564, 'p00448_3')
237 (5040, 'fixed')
238 (4130, 'p00436_5')
239 (4623, 'p00358_15')
240 (1155, 'fixed')
241 (4050, 'p00482_0')
242 (4260, 'p00436_6')
243 (4560, 'p00405osc9x3_0')
244 (3364, 'fixed')
245 (4182, 'p00482_1')
246 (1496, 'fixed')
247 (4899, 'p00358_17')
248 (3575, 'p00356x2_2')
249 (4316, 'p00482_2')
250 (4526, 'p00436_8')
251 (5040, 'p00358_18')
252 (4060, 'p00448_7')
253 (4452, 'p00482_3')
254 (4216, 'fixed')
255 (5084, 'p00385osc15x3_5')
256 (2401, 'fixed')
257 (4590, 'p00482_4')
258 (4800, 'p00436_10')
259 (4130, 'p00518osc7_0_p00259')
260 (4047, 'fixed')
261 (4466, 'fixed')
262 (4940, 'p00436_11')
263 (5041, 'fixed')
264 (2064, 'fixed')
265 (4872, 'p00482_6')
266 (5082, 'p00436_12')
267 (4284, 'p00356x3_0')
268 (4588, 'p00448_11')
269 (5016, 'p00482_7')
270 (1980, 'fixed')
271 (5032, 'p00534_1')
272 (4712, 'p00392osc16x2_2')
273 (4416, 'p00356x3_1')
274 (5175, 'fixed')
275 (4307, 'p00550osc5_0_p00275')
276 (1881, 'fixed')
277 (5310, 'p00482_9')
278 (4650, 'p00556_0')
279 (4425, 'p00558osc9_0_p00279')
280 (4331, 'p00356x2_8')
281 (5460, 'p00482_10')
282 (1700, 'fixed')
283 (5467, 'p00534_4')
284 (4320, 'fixed')
285 (4543, 'p00380osc15x3_0')
286 (4661, 'p00564_1_p00286')
287 (4543, 'p00518osc7_7_p00287')
288 (2100, 'fixed')
289 (5766, 'p00482_12')
290 (4720, 'p00564_2_p00290')
291 (4824, 'p00356x3_4')
292 (5110, 'p00358x2_10')
293 (5922, 'p00482_13')
294 (4437, 'p00482x3_1')
295 (4602, 'p00550osc5_5_p00295')
296 (3795, 'p00436x2_1')
297 (4964, 'p00356x3_5')
298 (4838, 'p00564_4_p00298')
299 (5106, 'p00590_1')
300 (1575, 'fixed')
301 (5538, 'p00602osc7_0')
302 (4897, 'p00564_5_p00302')
303 (5106, 'p00356x3_6')
304 (4158, 'p00456osc16x2_0')
305 (5538, 'p00570osc5_5')
306 (2550, 'fixed')
307 (5244, 'p00590_3')
308 (3256, 'fixed')
309 (5250, 'p00356x3_7')
310 (5015, 'p00564_7_p00310')
311 (5313, 'p00590_4')
312 (1848, 'fixed')
313 (5642, 'p00618_1_p00313')
314 (5074, 'p00564_8_p00314')
315 (4897, 'p00550osc5_10_p00315')
316 (5605, 'p00608_3_p00316')
317 (5704, 'p00618_2_p00317')
318 (5133, 'p00564_9_p00318')
319 (5530, 'p00590_6')
320 (4774, 'p00640_0')
321 (5544, 'p00356x3_9')
322 (2397, 'fixed')
323 (5680, 'p00590_7')
324 (4914, 'p00640_1')
325 (5828, 'p00618_4_p00325')
326 (5278, 'p00652_0_p00326')
327 (4158, 'p00436x3_0')
328 (4575, 'p00436x2_7')
329 (5890, 'p00618_5_p00329')
330 (2352, 'fixed')
331 (5544, 'p00662_0')
332 (4368, 'p00482x2_2')
333 (4290, 'p00436x3_1')
334 (5394, 'p00652_2_p00334')
335 (5280, 'p00550osc5_15_p00335')
336 (4422, 'p00448bx3_0')
337 (6014, 'p00618_7_p00337')
338 (5452, 'p00652_3_p00338')
339 (4424, 'p00436x3_2')
340 (5494, 'p00640_5')
341 (5609, 'fixed')
342 (4556, 'p00448x3_1')
343 (4484, 'p00686_0')
344 (4992, 'p00436x2_10')
345 (3850, 'p00345x3_0')
346 (5568, 'p00652_5_p00346')
347 (4620, 'p00686_1')
348 (4692, 'p00448x3_2')
349 (6048, 'p00698_0')
350 (3816, 'p00350osc5_0')
351 (4698, 'p00436x3_4')
352 (2964, 'fixed')
353 (3087, 'fixed')
354 (4830, 'p00448x3_3')
355 (4898, 'p00686_3')
356 (3127, 'p00356b_0')
357 (4838, 'p00436x3_5')
358 (2808, 'p00358_0')
359 (5040, 'p00686_4')
360 (1518, 'fixed')
361 (4218, 'p00345_2')
362 (5800, 'p00652_9_p00362')
363 (3660, 'p00363b_0')
364 (3240, 'p00356_1')
365 (5727, 'p00714_2')
366 (2915, 'p00358_1')
367 (5330, 'p00686_6')
368 (1440, 'fixed')
369 (3180, 'p00369osc9_0')
370 (6018, 'p00652_11_p00370')
371 (3782, 'p00363_1')
372 (3355, 'p00356_2')
373 (5734, 'p00746_0_p00373')
374 (3024, 'p00358_2')
375 (5270, 'p00436x3_8')
376 (2074, 'fixed')
377 (4484, 'p00345_4')
378 (5402, 'p00448x3_7')
379 (3906, 'p00363_2')
380 (3472, 'p00356_3')
381 (5418, 'p00436x3_9')
382 (3135, 'p00358_3')
383 (5780, 'p00758_1_p00383')
384 (3588, 'fixed')
385 (3348, 'p00385osc5_0')
386 (6237, 'p00740_4_p00386')
387 (4032, 'p00363_3')
388 (3591, 'p00356_4')
389 (6076, 'p00746_4_p00389')
390 (2970, 'fixed')
391 (5916, 'p00758_3_p00391')
392 (3894, 'p00392b_0')
393 (4636, 'p00345x3_6')
394 (6565, 'p00740_6_p00394')
395 (4160, 'p00363_4')
396 (2632, 'fixed')
397 (6400, 'p00746_6_p00397')
398 (3363, 'p00358_5')
399 (5200, 'p00399osc7x3_0')
400 (3763, 'fixed')
401 (4898, 'p00345_7')
402 (3712, 'p00402osc6_0')
403 (4290, 'p00363_5')
404 (3835, 'p00356_6')
405 (3886, 'p00405osc5_0')
406 (3480, 'p00358_6')
407 (3886, 'fixed')
408 (3965, 'p00408osc6_0')
409 (5040, 'p00345_8')
410 (5175, 'p00410osc5_0')
411 (4422, 'p00363_6')
412 (3960, 'p00356_7')
413 (4080, 'p00413osc7_0')
414 (2597, 'fixed')
415 (6510, 'p00726_13_p00415')
416 (2028, 'fixed')
417 (5056, 'p00345x3_9')
418 (4212, 'p00418_0')
419 (4556, 'p00363_7')
420 (2448, 'fixed')
421 (3960, 'fixed')
422 (3720, 'p00358_8')
423 (4095, 'p00423osc9_0')
424 (4410, 'p00392_4')
425 (3953, 'p00385osc5_5')
426 (4087, 'p00402osc6_3')
427 (4692, 'p00363_8')
428 (4216, 'p00356_9')
429 (4189, 'fixed')
430 (3038, 'fixed')
431 (6596, 'p00862_0_p00431')
432 (2160, 'fixed')
433 (5478, 'p00345_11')
434 (4480, 'p00418_2')
435 (4830, 'p00363_9')
436 (3510, 'p00436_0')
437 (6720, 'p00874_0_p00437')
438 (3968, 'p00358_10')
439 (4200, 'fixed')
440 (2842, 'fixed')
441 (4071, 'fixed')
442 (4617, 'p00418_3')
443 (3498, 'p00443b_0')
444 (3630, 'p00436_1')
445 (4428, 'p00445_0')
446 (4095, 'p00358_11')
447 (6490, 'p00886_1_p00447')
448 (3213, 'p00448b_0')
449 (5022, 'p00441_1')
450 (2294, 'fixed')
451 (3618, 'p00443_1')
452 (3752, 'p00436_2')
453 (4565, 'p00445_1')
454 (4224, 'p00358_12')
455 (4556, 'p00455osc5_0')
456 (3328, 'p00448_1')
457 (3953, 'fixed')
458 (4897, 'p00418_5')
459 (3740, 'p00443_2')
460 (3312, 'fixed')
461 (4704, 'p00445_2')
462 (4355, 'p00358_13')
463 (6832, 'p00886_5_p00463')
464 (3445, 'p00448_2')
465 (4026, 'p00465osc5_0')
466 (5040, 'p00418_6')
467 (3864, 'p00443_3')
468 (2610, 'fixed')
469 (4845, 'p00445_3')
470 (3840, 'fixed')
471 (4818, 'fixed')
472 (3564, 'p00448_3')
473 (5313, 'p00457_2')
474 (4740, 'fixed')
475 (3990, 'p00443_4')
476 (4130, 'p00436_5')
477 (4988, 'p00445_4')
478 (4623, 'p00358_15')
479 (7308, 'p00886_9_p00479')
480 (2668, 'fixed')
481 (5460, 'p00457_3')
482 (4050, 'p00482_0')
483 (3685, 'p00483osc7_0')
484 (4260, 'p00436_6')
485 (5015, 'p00485_0')
486 (4760, 'p00358_16')
487 (7480, 'p00942_4_p00487')
488 (3364, 'fixed')
489 (5609, 'p00457_4')
490 (4182, 'p00482_1')
491 (4248, 'p00443_6')
492 (2080, 'fixed')
493 (5037, 'fixed')
494 (4899, 'p00358_17')
495 (5256, 'p00455osc5_5')
496 (3933, 'p00448_6')
497 (4615, 'p00497osc7_0')
498 (4316, 'p00482_2')
499 (4380, 'p00443_7')
500 (4526, 'p00436_8')
501 (5082, 'fixed')
502 (5040, 'p00358_18')
503 (7524, 'p00886_15_p00503')
504 (3025, 'fixed')
505 (4686, 'p00465osc5_5')
506 (4452, 'p00482_3')
507 (4514, 'p00443_8')
508 (4216, 'fixed')
509 (5456, 'p00485_3')
510 (2107, 'fixed')
511 (5372, 'fixed')
512 (3294, 'fixed')
513 (4891, 'p00513osc9_0')
514 (4590, 'p00482_4')
515 (4130, 'p00515osc5_0')
516 (4800, 'p00436_10')
517 (5504, 'fixed')
518 (4130, 'p00518osc7_0')
519 (6588, 'p00652x3_5_p00519')
520 (2944, 'fixed')
521 (5616, 'p00505_2')
522 (4588, 'fixed')
523 (4788, 'p00443_10')
524 (4940, 'p00436_11')
525 (3710, 'p00350osc5x3_0')
526 (5041, 'fixed')
527 (5112, 'fixed')
528 (2295, 'fixed')
529 (5767, 'p00505_3')
530 (4872, 'p00482_6')
531 (4453, 'p00531osc9_0')
532 (5082, 'p00436_12')
533 (5313, 'fixed')
534 (4189, 'p00534osc6_0')
535 (4828, 'p00535osc5_0')
536 (4588, 'p00448_11')
537 (3648, 'p00358x3_0')
538 (5016, 'p00482_7')
539 (4588, 'p00483osc7_7')
540 (2088, 'fixed')
541 (6072, 'p00485_7')
542 (5032, 'p00534_1')
543 (6580, 'p00708x3_2_p00543')
544 (4725, 'p00448_12')
545 (5396, 'p00465osc5_10')
546 (4416, 'p00356x3_1')
547 (5214, 'p00443_13')
548 (5175, 'fixed')
549 (3770, 'p00358x3_1')
550 (4307, 'p00550osc5_0')
551 (6408, 'fixed')
552 (1470, 'fixed')
553 (5074, 'p00553osc7_0')
554 (5310, 'p00482_9')
555 (4800, 'p00515osc5_5')
556 (4650, 'p00556_0')
557 (5254, 'p00549_1')
558 (4366, 'p00534osc6_3')
559 (5180, 'p00559_0')
560 (5005, 'p00448_14')
561 (3894, 'p00358x3_2')
562 (5460, 'p00482_10')
563 (5508, 'p00443_15')
564 (2107, 'fixed')
565 (5325, 'p00549_2')
566 (5467, 'p00534_4')
567 (5183, 'p00567osc7_0')
568 (4320, 'fixed')
569 (5106, 'p00561_1')
570 (4543, 'p00380osc15x3_0')
571 (5160, 'p00571_0')
572 (4661, 'p00564_1')
573 (4020, 'p00358x3_3')
574 (4543, 'p00518osc7_7')
575 (5183, 'p00535osc5_5')
576 (2592, 'fixed')
577 (5175, 'p00561_2')
578 (5766, 'p00482_12')
579 (5220, 'p00571_1')
580 (4720, 'p00564_2')
581 (5168, 'p00581_0')
582 (4543, 'p00534osc6_6')
583 (5390, 'p00559_3')
584 (4836, 'p00568osc8_2')
585 (4148, 'p00358x3_4')
586 (5922, 'p00482_13')
587 (5280, 'p00571_2')
588 (4779, 'p00564_3')
589 (5313, 'p00581_1')
590 (4602, 'p00550osc5_5')
591 (5460, 'p00559_4')
592 (4015, 'p00436x4_1')
593 (5313, 'p00561_4')
594 (4964, 'p00356x3_5')
595 (5340, 'p00571_3')
596 (4838, 'p00564_4')
597 (4278, 'p00358x3_5')
598 (5022, 'fixed')
599 (5530, 'p00559_5')
600 (1785, 'fixed')
601 (5382, 'p00561_5')
602 (5538, 'p00602osc7_0')
603 (5400, 'p00571_4')
604 (4897, 'p00564_5')
605 (5609, 'p00581_3')
606 (4720, 'p00534osc6_9')
607 (5680, 'p00559_6')
608 (4992, 'p00568osc8_5')
609 (4410, 'p00358x3_6')
610 (5538, 'p00570osc5_5')
611 (5460, 'p00571_5')
612 (3621, 'fixed')
613 (5760, 'p00581_4')
614 (5244, 'p00590_3')
615 (5336, 'p00615_0')
616 (3478, 'fixed')
617 (5680, 'p00561_7')
618 (5192, 'p00618osc6_0')
619 (5520, 'p00571_6')
620 (5015, 'p00564_7')
621 (4544, 'p00358x3_7')
622 (5313, 'p00590_4')
623 (5394, 'p00615_1')
624 (2115, 'fixed')
625 (5313, 'p00625osc5_0')
626 (5642, 'p00618_1')
627 (4104, 'p00418x3_0')
628 (5074, 'p00564_8')
629 (6068, 'p00581_6')
630 (2700, 'fixed')
631 (5452, 'p00615_2')
632 (4872, 'p00616osc8_2')
633 (4680, 'p00358x3_8')
634 (5704, 'p00618_2')
635 (5640, 'p00571_8')
636 (5133, 'p00564_9')
637 (6225, 'p00581_7')
638 (5530, 'p00590_6')
639 (4235, 'p00418x3_1')
640 (4774, 'p00640_0')
641 (6142, 'p00561_10')
642 (5251, 'p00642osc6_0')
643 (5307, 'p00643_0')
644 (3498, 'fixed')
645 (4662, 'p00430osc15x3_0')
646 (5680, 'p00590_7')
647 (5568, 'p00615_4')
648 (2907, 'fixed')
649 (5640, 'p00649_0')
650 (5828, 'p00618_4')
651 (4368, 'p00418x3_2')
652 (5278, 'p00652_0')
653 (6391, 'p00653_0')
654 (4158, 'p00436x3_0')
655 (5626, 'p00615_5')
656 (4819, 'p00436x4_7')
657 (4958, 'p00358x3_10')
658 (3008, 'fixed')
659 (5429, 'p00643_2')
660 (2820, 'fixed')
661 (6468, 'p00653_1')
662 (5544, 'p00662_0')
663 (4503, 'p00418x3_3')
664 (4420, 'p00482x4_2')
665 (5940, 'p00665osc7_0')
666 (4290, 'p00436x3_1')
667 (5490, 'p00643_3')
668 (5394, 'p00652_2')
669 (5100, 'p00358x3_11')
670 (5192, 'p00550osc5_15')
671 (5742, 'p00615_7')
672 (4422, 'p00448bx3_0')
673 (6111, 'p00649_3')
674 (6014, 'p00618_7')
675 (4640, 'p00418x3_4')
676 (5452, 'p00652_3')
677 (6622, 'p00653_3')
678 (4424, 'p00436x3_2')
679 (5800, 'p00615_8')
680 (5208, 'p00616osc8_8')
681 (4980, 'p00681_0')
682 (5609, 'fixed')
683 (4920, 'p00683_0')
684 (4556, 'p00448x3_1')
685 (5340, 'p00645osc5_5')
686 (4484, 'p00686_0')
687 (4779, 'p00418x3_5')
688 (5248, 'p00436x4_10')
689 (5124, 'p00681_1')
690 (1248, 'fixed')
691 (4980, 'p00683_1')
692 (5568, 'p00652_5')
693 (5208, 'p00693_0')
694 (4620, 'p00686_1')
695 (6018, 'p00615_10')
696 (4692, 'p00448x3_2')
697 (5185, 'p00681_2')
698 (6048, 'p00698_0')
699 (4920, 'p00418x3_6')
700 (5508, 'fixed')
701 (5270, 'p00693_1')
702 (4698, 'p00436x3_4')
703 (6180, 'p00615_11')
704 (3724, 'fixed')
705 (5332, 'p00681_3')
706 (3905, 'fixed')
707 (5185, 'p00683_3')
708 (4830, 'p00448x3_3')
709 (5418, 'p00693_2')
710 (4898, 'p00686_3')
711 (5063, 'p00418x3_7')
712 (3339, 'p00356x2_0')
713 (5394, 'p00681_4')
714 (4838, 'p00436x3_5')
715 (5332, 'p00683_4')
716 (3780, 'p00358x2_0')
717 (5481, 'p00693_3')
718 (5040, 'p00686_4')
719 (5808, 'p00719_0')
720 (1880, 'fixed')
721 (5395, 'p00721_0')
722 (4959, 'p00345x2_2')
723 (4300, 'p00482x3_0')
724 (5504, 'p00724_0')
725 (5632, 'p00693_4')
726 (4757, 'p00363x2_0')
727 (5874, 'p00719_1')
728 (2684, 'fixed')
729 (5460, 'p00721_1')
730 (5727, 'p00714_2')
731 (5544, 'p00683_6')
732 (3904, 'p00358x2_1')
733 (5696, 'p00693_5')
734 (5330, 'p00686_6')
735 (4182, 'p00490osc15x3_0')
736 (2310, 'fixed')
737 (5525, 'p00721_2')
738 (2009, 'fixed')
739 (5607, 'p00683_7')
740 (5605, 'p00740_0')
741 (5850, 'p00693_6')
742 (4896, 'p00363x2_1')
743 (5984, 'p00743_0')
744 (3575, 'p00356x2_2')
745 (5590, 'p00721_3')
746 (5734, 'p00746_0')
747 (4576, 'p00482x3_2')
748 (4030, 'p00358x2_2')
749 (5915, 'p00693_7')
750 (3564, 'fixed')
751 (6052, 'p00743_1')
752 (2440, 'fixed')
753 (5655, 'p00721_4')
754 (5251, 'p00345x2_4')
755 (5824, 'p00683_9')
756 (5402, 'p00448x3_7')
757 (6052, 'p00741_2')
758 (5037, 'p00363x2_2')
759 (4717, 'p00482x3_3')
760 (3696, 'p00356x2_3')
761 (5720, 'p00721_5')
762 (5168, 'fixed')
763 (5980, 'p00683_10')
764 (4158, 'p00358x2_3')
765 (6120, 'p00741_3')
766 (5695, 'p00726_5')
767 (6188, 'p00743_3')
768 (3430, 'fixed')
769 (5874, 'p00721_6')
770 (5400, 'p00345x2_5')
771 (4860, 'p00482x3_4')
772 (6164, 'p00724_6')
773 (6188, 'p00741_4')
774 (5180, 'p00363x2_3')
775 (6348, 'p00743_4')
776 (3819, 'p00356x2_4')
777 (5355, 'p00518osc7x3_0_p00777')
778 (6076, 'p00746_4')
779 (6204, 'p00683_12')
780 (2989, 'fixed')
781 (6348, 'p00741_5')
782 (5829, 'p00726_7')
783 (5005, 'p00482x3_5')
784 (4588, 'p00392osc16x2_0')
785 (6097, 'p00721_8')
786 (5307, 'p00345x6_6')
787 (6270, 'p00683_13')
788 (6392, 'p00724_8')
789 (6035, 'fixed')
790 (5325, 'p00363x2_4')
791 (6580, 'p00743_6')
792 (2752, 'fixed')
793 (6164, 'p00721_9')
794 (6400, 'p00746_6')
795 (4872, 'p00490osc15x3_5')
796 (4420, 'p00358x2_5')
797 (6580, 'p00741_7')
798 (5874, 'p00436x3_12')
799 (6650, 'p00743_7')
800 (4800, 'p00392x2_1')
801 (6048, 'p00534x3_0')
802 (5704, 'p00345x2_7')
803 (6499, 'p00683_15')
804 (5112, 'p00402osc6x2_0')
805 (5508, 'fixed')
806 (5472, 'p00363x2_5')
807 (5301, 'p00482x3_7')
808 (4071, 'p00356x2_6')
809 (6392, 'p00721_11')
810 (2640, 'fixed')
811 (6664, 'p00683_16')
812 (4554, 'p00358x2_6')
813 (6205, 'p00534x3_1')
814 (6279, 'p00726_11')
815 (6728, 'p00815_0')
816 (4420, 'p00408osc48x2_0')
817 (6555, 'p00721_12')
818 (5859, 'p00345x2_8')
819 (5452, 'p00482x3_8')
820 (6806, 'p00410osc5x2_0')
821 (6831, 'p00813_1')
822 (5621, 'p00363x2_6')
823 (6786, 'p00815_1')
824 (4200, 'p00356x2_7')
825 (5544, 'p00550osc5x3_0_p00825')
826 (4800, 'p00413osc7x2_0')
827 (5822, 'p00827_0')
828 (3312, 'fixed')
829 (6831, 'p00813_2')
830 (6510, 'p00726_13')
831 (5605, 'p00482x3_9')
832 (2592, 'fixed')
833 (6790, 'p00721_14')
834 (5025, 'p00556x3_0')
835 (5893, 'p00827_1')
836 (4914, 'p00418x2_0')
837 (5670, 'p00558osc9x3_0_p00837')
838 (5772, 'p00363x2_7')
839 (6902, 'p00815_3')
840 (2736, 'fixed')
841 (6222, 'p00841_0')
842 (6903, 'p00802_5')
843 (5760, 'p00482x3_10')
844 (4828, 'p00358x2_8')
845 (5880, 'fixed')
846 (2322, 'fixed')
847 (5727, 'p00847osc7_0')
848 (4914, 'p00392osc16x2_4')
849 (6386, 'p00841_1')
850 (6175, 'p00345x2_10')
851 (6048, 'p00827_3')
852 (4840, 'p00418x6_1')
853 (6386, 'p00853_0')
854 (5925, 'p00363x2_8')
855 (5917, 'p00482x3_11')
856 (4464, 'p00356x2_9')
857 (6552, 'p00841_2')
858 (5313, 'p00556x3_2')
859 (6048, 'p00827_4')
860 (4352, 'fixed')
861 (5796, 'p00518osc7x3_7_p00861')
862 (6596, 'p00862_0')
863 (6720, 'p00863_0')
864 (2430, 'fixed')
865 (6300, 'fixed')
866 (6336, 'p00345x2_11')
867 (6076, 'p00482x3_12')
868 (5208, 'p00418x2_2')
869 (6720, 'p00853_2')
870 (2852, 'fixed')
871 (6784, 'p00863_1')
872 (3672, 'p00436x2_0')
873 (6344, 'p00582osc3x3_0')
874 (6720, 'p00874_0')
875 (6120, 'fixed')
876 (5110, 'p00358x2_10')
877 (6572, 'p00853_3')
878 (5530, 'fixed')
879 (6237, 'p00482x3_13')
880 (3306, 'fixed')
881 (6420, 'p00865_2')
882 (4941, 'p00441x2_0')
883 (6364, 'p00827_7')
884 (5358, 'p00418x2_3')
885 (5859, 'p00550osc5x3_5_p00885')
886 (4891, 'p00443x2_0')
887 (6864, 'p00879_1')
888 (3795, 'p00436x2_1')
889 (6480, 'p00865_3')
890 (5580, 'p00445x2_0')
891 (6364, 'p00827_8')
892 (5254, 'p00358x2_11')
893 (6696, 'p00853_5')
894 (5760, 'p00556x3_5')
895 (6720, 'p00895_0')
896 (5022, 'fixed')
897 (6314, 'p00590x3_1')
898 (5084, 'p00441x2_1')
899 (6525, 'p00827_9')
900 (2257, 'fixed')
901 (6758, 'p00853_6')
902 (5032, 'p00443x2_1')
903 (6264, 'p00847osc7_7')
904 (3920, 'p00436x2_2')
905 (6600, 'p00865_5')
906 (5734, 'p00445x2_1')
907 (6525, 'p00827_10')
908 (5400, 'p00358x2_12')
909 (6396, 'p00590x3_2')
910 (5100, 'p00455osc5x2_0')
911 (6840, 'p00895_2')
912 (4158, 'p00456osc16x2_0')
913 (6660, 'p00865_6')
914 (5229, 'p00441x2_2')
915 (6097, 'fixed')
916 (5664, 'p00418x2_5')
917 (6660, 'p00861osc7_7')
918 (3472, 'fixed')
919 (6900, 'p00895_3')
920 (3312, 'fixed')
921 (6478, 'p00590x3_3')
922 (5890, 'p00445x2_2')
923 (6688, 'p00827_12')
924 (3922, 'fixed')
925 (6660, 'p00885osc5_5')
926 (6710, 'p00886_5')
927 (6030, 'p00618x3_0_p00927')
928 (5916, 'p00408x2_7')
929 (6780, 'p00865_8')
930 (3666, 'fixed')
931 (6794, 'p00875osc7_7')
932 (5820, 'p00418x2_6')
933 (6560, 'p00590x3_4')
934 (5320, 'p00443x2_3')
935 (7020, 'p00895_5')
936 (3074, 'fixed')
937 (6840, 'p00865_9')
938 (5829, 'p00413osc7x2_7')
939 (6097, 'p00618x3_1_p00939')
940 (4416, 'fixed')
941 (7068, 'p00853_11')
942 (6205, 'fixed')
943 (7080, 'p00895_6')
944 (4424, 'p00456osc16x2_2')
945 (6174, 'p00550osc5x3_10_p00945')
946 (5525, 'p00441x2_4')
947 (7020, 'p00827_15')
948 (5734, 'p00418x6_7')
949 (7130, 'p00853_12')
950 (5467, 'p00443x2_4')
951 (6164, 'p00618x3_2_p00951')
952 (4307, 'p00436x2_5')
953 (6960, 'p00865_11')
954 (5984, 'p00405osc9x2_9')
955 (6875, 'p00915osc5_5')
956 (5850, 'p00358x2_15')
957 (6724, 'p00590x3_6')
958 (6930, 'p00886_9')
959 (6840, 'p00847osc7_14')
960 (3190, 'fixed')
961 (7020, 'p00865_12')
962 (5676, 'p00441x2_5')
963 (6231, 'p00618x3_3_p00963')
964 (4100, 'p00482x2_0')
965 (7068, 'p00885osc5_10')
966 (3685, 'fixed')
967 (7381, 'p00895_9')
968 (4440, 'p00436x2_6')
969 (6806, 'p00590x3_7')
970 (6240, 'p00485x2_0')
971 (7189, 'p00827_18')
972 (6004, 'p00358x2_16')
973 (7254, 'p00861osc7_14')
974 (7168, 'p00886_11')
975 (6298, 'fixed')
976 (3944, 'fixed')
977 (7140, 'p00865_14')
978 (5829, 'p00441x2_6')
979 (7360, 'p00827_19')
980 (4233, 'p00482x2_1')
981 (4840, 'p00436x9_0')
982 (5767, 'p00443x2_6')
983 (7626, 'p00895_11')
984 (2080, 'fixed')
985 (7320, 'p00865_15')
986 (6402, 'p00485x2_1')
987 (6365, 'p00618x3_5_p00987')
988 (6160, 'p00358x2_17')
989 (7440, 'p00853_17')
990 (3600, 'fixed')
991 (7688, 'p00895_12')
992 (4930, 'p00488osc8x2_1')
993 (5544, 'p00662x3_0')
994 (5984, 'p00441x2_7')
995 (7150, 'p00915osc5_10')
996 (4368, 'p00482x2_2')
997 (7502, 'p00853_18')
998 (5920, 'p00443x2_7')
999 (4895, 'p00436x9_1')"""
readmelist = readme.split("\n")
warnings = ""
for item in readmelist:
period, size, basegun = item.split(" ")
basegun=basegun.replace("'","").replace(")","")
if basegun=="fixed":
g.show("[fixed]")
continue
datalist = basegun.split("_")
if len(datalist)==2:
baseperiod, adjustment = datalist
else:
baseperiod, adjustment, finalperiod = datalist
subperiod = 1
temp = baseperiod.split('x')
if len(temp)==2:
subperiod = int(temp[1])
iperiod, iadjustment = int(period), int(adjustment)
# if iperiod<336:
# continue #######
if baseperiod not in baseguns:
g.show(period)
continue
basepat, dx, dy, finaladjustment = baseguns[baseperiod]
# g.note(baseperiod + " length of pattern cell list: "+str(len(basepat))) ###############
fixedpat,movablepat,output,signal=[],[],[],[]
for i in range(0,len(basepat)-1,3):
if basepat[i+2]==1:
fixedpat+=basepat[i:i+3]
elif basepat[i+2]==3:
movablepat+=basepat[i:i+2]+[1]
elif basepat[i+2]==4:
output+=basepat[i:i+2]+[0]
elif basepat[i+2]==5:
signal+=basepat[i:i+2]+[1]
else:
g.exit("Don't know that color: "+str(basepat[i+2]))
if len(fixedpat)%2 == 0: fixedpat+=[0]
if len(movablepat)%2 == 0: movablepat+=[0]
if len(output)%2 == 0: output+=[0]
if len(signal)%2 == 0: signal+=[0]
g.new(basegun)
g.putcells(fixedpat)
g.putcells(movablepat, iadjustment*dx, iadjustment*dy)
done = 0
g.setrule("Life")
r=g.getrect()
while done == 0:
g.putcells(signal)
g.run(iperiod/subperiod)
g.fit()
g.update()
if g.getcell(signal[0],signal[1])==1: done=1
g.run(finaladjustment)
g.run(iperiod*100/subperiod)
# g.note(str(subperiod))
if subperiod>1 and g.getcell(output[0],output[1])!=1:
countdown=subperiod
g.setgen("0")
while countdown>=0:
countdown-=1
g.run(iperiod/subperiod)
g.update()
g.show("Counting down: "+str(countdown))
if g.getcell(output[0],output[1])==1:
break
if g.getcell(output[0],output[1])!=1:
g.exit("Looks like something went wrong at period " + period + ".")
g.select(r)
g.clear(1)
g.select([])
g.setgen("0")
#check we get the expected size
size = int(size.replace(",","").replace("(",""))
if r[2]<r[3]:
warnings+="\nbad orientation " + item
if r[2] * r[3] != size:
warnings+="\nbad size " + item
maxx = r[0] + r[2]
maxy = r[1] + r[3]
g.show("Done! "+ os.path.join(outfolder,str(period)))
g.save(os.path.join(outfolder,str(iperiod+100000)[1:]+"_"+basegun+".rle"),"rle")
#bbox should increase in the south or east
g.run(1)
r = g.getrect()
if r[0] + r[2] <= maxx and r[1] + r[3] <= maxy:
warnings+="\nno escape " + item
g.note("Done. Errors:\n"+warnings)