from pathlib import Path W = 80 ESC = "\x1b[" rows = [ ("34", " . . . * . . "), ("34", " . * . . . "), ("36", " * . . * . "), ("34", " . * . . "), ("35", " . . * "), ("35", " .-=========-. . "), ("35", " .-===============-. "), ("95", " .=====================. "), ("95", " ========================= "), ("95", " ========================= "), ("35", " '=====================' "), ("35", " '===========---' "), ("36", "___________________________.----._________________________________________"), ("36", "\\ .-'''''/ \\'''''-. / "), ("36", " \\ .-' / \\ '-. / "), ("36", " \\ .-' / \\ '-. / "), ("36", " \\ .-' / \\ '-. / "), ("36", " \\/ / \\ \\/ "), ("94", " \\ / \\ / "), ("94", " \\ / \\ / "), ("94", " \\ / \\ / "), ("94", " \\ / \\ / "), ("35", " \\_/ \\_/ "), ("97", " SIGNAL RECEIVED // 198X // NO RETURN "), ("90", " N A O R A I T R A N S M I S S I O N "), ] assert len(rows) == 25 out = ESC + "H" for index, (color, line) in enumerate(rows): assert len(line) <= W, (len(line), line) line = line.ljust(W) out += ESC + color + "m" + line if index < len(rows) - 1: out += "\r\n" out += ESC + "0m" Path("no-return.ans").write_bytes(out.encode("cp437")) print({"rows": len(rows), "bytes": len(out.encode("cp437")), "path": "no-return.ans"})