Anonymous user
Honeycombs/Python: Difference between revisions
m
changed comment
mNo edit summary |
m (changed comment) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 3:
'''
▲ The code includes doctests. Suggested program use:
$ python3 -m doctest hexagons.py
Line 81 ⟶ 79:
str(mandatory_arguments))
self.kwargs = kwargs
for kv in kwargs.items():
def __repr__(self):
return self.__class__.__name__+'(**'+pprint.pformat(self.kwargs)+')'
▲ return self.kwargs[item]
class Ngon(Base):
Line 144 ⟶ 138:
'''
Of course I could have used numpy.
>>> P = Vector(P=(1,2,))
Line 308 ⟶ 302:
UC = list(string.ascii_uppercase)
random.shuffle(UC)
HC = HoneyComb(s=UC,rotation=0 and not 0.52)
print(HC())
# ha ha, Turns out I always wanted to invoke main during tests.
# (module name is not __main__ when invoked from doctest)
if '__main__' == __name__:
main()
Line 327 ⟶ 323:
# ........ x
</lang>
--LambertDW 17:19, 27 March 2012 (UTC)
|