#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import curses
import time

SKULLS = ("""
                 ▒▒▒▒▒▒▒
             ▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒
          ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒
         ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
        ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
       ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
       ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
       ▒▓▓▓▓▓▓░   ░▓▓▓░   ░▓▓▓▓▓▓▒
       ░▓▓▓▓░      ▒▓▒       ▓▓▓▓░
        ▓▓▓▒       ▒▓▒       ▒▓▓▓
        ▓▓▓▒      ▒▓▓▓▒      ▒▓▓▓
         ░▓▓▓▓▒▒▓▓▓   ▓▓▓▒▒▓▓▓▓░
          ░▓▓▓▓▓▓▓░   ░▓▓▓▓▓▓▓░
            ▒▓▓▓▓▓▓▓▒▓▓▓▓▓▓▓▒
             ▒▓░▓░▓░▓░▓░▓░▓▒
  ▒▒▒        ▓▓▒▓ ▓ ▓ ▓ ▓▒▓▓       ▒▒▒
 ▒▓▓▓▓        ▓▓▓▓▓▒▓▒▓▒▓▓▓       ▒▓▓▓▓
  ▓▓▓▓▓▒▒      ░▓▓▓▓▓▓▓▓▓░     ▒▒▓▓▓▓▓▓
▒▓▓▓▓▓▓▓▓▓▓▓▒▒    ░░░░░    ▒▒▒▒▓▓▓▓▓▓▓▓▓▓
▓▓▓▓░░░▓▓▓▓▓▓▓▓▓▓▒▒▒   ▒▒▓▓▓▓▓▓▓▓▓░░░▓▓▓░
 ▒▒▒      ░░▓▓▓▓▓▓▓▓▓▓▓▒▒ ░░▓░░░
           ▒▒▒▒ ░░▓▓▓▓▓▓▓▓▓▓▒▒▒
  ▒▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▒▒ ░░▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓
  ▓▓▓▓▓▓▓▓▓▓░░░░           ░░▓▓▓▓▓▓▓▓▓▓▓░
   ░▓▓▓▓▓░                      ░░▓▓▓▓░░
     ▓▓▓░                         ▓▓▓▓░
""", """
                 ▒▒▒▒▒▒▒
             ▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒
          ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒
         ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
        ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
       ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
       ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒
       ▒▓▓▓▓▓▓░   ░▓▓▓░   ░▓▓▓▓▓▓▒
       ░▓▓▓▓░      ▒▓▒       ▓▓▓▓░
        ▓▓▓▒       ▒▓▒       ▒▓▓▓
        ▓▓▓▒      ▒▓▓▓▒      ▒▓▓▓
         ░▓▓▓▓▒▒▓▓▓   ▓▓▓▒▒▓▓▓▓░
          ░▓▓▓▓▓▓▓░   ░▓▓▓▓▓▓▓░
            ▒▓▓▓▓▓▓▓▒▓▓▓▓▓▓▓▒
             ▒▓░▓░▓░▓░▓░▓░▓▒

  ▒▒▒        ▓▓▒▓ ▓ ▓ ▓ ▓▒▓▓       ▒▒▒
 ▒▓▓▓▓        ▓▓▓▓▓▒▓▒▓▒▓▓▓       ▒▓▓▓▓
  ▓▓▓▓▓▒▒      ░▓▓▓▓▓▓▓▓▓░     ▒▒▓▓▓▓▓▓
▒▓▓▓▓▓▓▓▓▓▓▓▒▒    ░░░░░    ▒▒▒▒▓▓▓▓▓▓▓▓▓▓
▓▓▓▓░░░▓▓▓▓▓▓▓▓▓▓▒▒▒   ▒▒▓▓▓▓▓▓▓▓▓░░░▓▓▓░
 ▒▒▒      ░░▓▓▓▓▓▓▓▓▓▓▓▒▒ ░░▓░░░
           ▒▒▒▒ ░░▓▓▓▓▓▓▓▓▓▓▒▒▒
  ▒▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▒▒ ░░▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓
  ▓▓▓▓▓▓▓▓▓▓░░░░           ░░▓▓▓▓▓▓▓▓▓▓▓░
   ░▓▓▓▓▓░                      ░░▓▓▓▓░░
     ▓▓▓░                         ▓▓▓▓░

                    HA
""")

def tick(stdscr, onoff):
    stdscr.clear()
    selection = SKULLS[1] if onoff else SKULLS[0]
    for (y, line) in enumerate(selection.split('\n')):
        stdscr.addstr(curses.LINES // 2 - 15 + y, curses.COLS // 2 - 20, line)
    stdscr.addch(curses.LINES - 2, curses.COLS - 2, ' ')
    stdscr.refresh()
    return not onoff

def main(stdscr):
    onoff = False
    while True:
        onoff = tick(stdscr, onoff)
        time.sleep(1.0)

curses.wrapper(main)