72 | 72 |
argparser.add_argument("--display-window", metavar='RANGE', default=None,
|
73 | 73 |
help="A string in the form '(x1,y1)-(x2-y2)'; if given, every generation "
|
74 | 74 |
"displayed will only display the cells within this fixed window"
|
|
75 |
)
|
|
76 |
argparser.add_argument("--display-svg", action="store_true",
|
|
77 |
help="Display each generation as SVG"
|
75 | 78 |
)
|
76 | 79 |
argparser.add_argument("--write-discrete-files-to", metavar='DIRNAME', default=None,
|
77 | 80 |
help="If given, instead of displaying each generation on standard output, "
|
|
151 | 154 |
|
152 | 155 |
def output_frame(count, pf):
|
153 | 156 |
if options.display_window:
|
154 | |
rendered = pf.to_str(display_x1, display_y1, display_x2, display_y2)
|
|
157 |
if options.display_svg:
|
|
158 |
rendered = pf.to_svg(display_x1, display_y1, display_x2, display_y2)
|
|
159 |
else:
|
|
160 |
rendered = pf.to_str(display_x1, display_y1, display_x2, display_y2)
|
155 | 161 |
else:
|
156 | |
rendered = str(pf)
|
|
162 |
if options.display_svg:
|
|
163 |
rendered = pf.to_svg(pf.min_x, pf.min_y, pf.max_x, pf.max_y)
|
|
164 |
else:
|
|
165 |
rendered = str(pf)
|
157 | 166 |
|
158 | 167 |
if options.write_discrete_files_to:
|
159 | 168 |
with open(os.path.join(options.write_discrete_files_to, "%08d.txt" % count), 'w') as f:
|