Thought Email List: space rocket design and manufacture From: rocket engineer To: all subscribers Subject: rocket demo !!!! :D :D The team has put together a prototype launch demo. We are very proud of this work. There are some remaining small issues, but it works well enough for a launch demo. #!/usr/bin/env python3 # space venture 2 import sys, time import blessings class RocketShip: def __init__(self, material=sys.stdout): self.material = blessings.Terminal(stream=material) self.head_room = 8 def build(self): self.position(0) self.nose() self.body() self.tail_exhaust() return self def launch(self): for pos in range(0, self.space): time.sleep(0.3) self.position(pos) self.nose() self.body() self.tail_exhaust(pos) return self @property def space(self): return self.material.height def position(self, altitude): coords = self.material.move(max(0,self.space - altitude - self.head_room), 0) self.material.stream.write(coords) self._altitude = altitude def _build_launch(self, plan): if self._altitude > -self.head_room and self._altitude <= self.space - self.head_room: self.material.stream.write(f'{plan}\n') self._altitude -= 1 def nose(self): self._build_launch(r''' ^ ''') self._build_launch(r''' / \ ''') self._build_launch(r''' / \ ''') def body(self): self._build_launch(r''' | | ''') self._build_launch(r''' | | ''') self._build_launch(r''' | | ''') def tail_exhaust(self, mod=0): if mod % 2: self._build_launch(r''' |$$$| ''') self._build_launch(r'''/$$$ \ ''') self._build_launch(r''' $$$ ''') self._build_launch(r''' $ $ ''') self._build_launch(r''' ''') else: self._build_launch(r''' |$$$| ''') self._build_launch(r'''/ $$$\ ''') self._build_launch(r''' $$$ ''') self._build_launch(r''' $ $ ''') self._build_launch(r''' ''') RocketShip().build().launch()