RunCollatz - -class Reader(object def read(self return...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#!/usr/bin/env python # ------------------------------------- # projects/python/collatz/RunCollatz.py # Copyright (C) 2010 # Glenn P. Downing # ------------------------------------- # To run the program # RunCollatz.py < RunCollatz.in > RunCollatz.out # To document the program # pydoc -w Collatz RunCollatz TestCollatz from Collatz import collatz_read, collatz_eval, collatz_print # ------ # Reader
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # ------class Reader (object) : def read (self) : return raw_input() # ------# Writer # ------class Writer (object) : def write (self, a, v) : for i in a : print i, print v # ----# main # ----def main () : """ runs the program """ a = while collatz_read(Reader(), a) : v = collatz_eval(a) collatz_print(Writer(), a, v) if __name__ == "__main__" : main()...
View Full Document

This note was uploaded on 04/05/2010 for the course CS 373 taught by Professor Downing,glennp during the Fall '08 term at University of Texas.

Ask a homework question - tutors are online