Spite in python
import curses | |
SPADE, HEART, DIAMOND, CLUB = '♠♥♦♣' | |
BOX = { | |
'light': ('┌───┐', | |
'│ │', | |
'│ │', | |
'└───┘'), | |
'heavy': ('┏━━━┓', | |
'┃ ┃', | |
'┃ ┃', | |
'┗━━━┛'), | |
'double': ('╔═══╗', | |
'║ ║', | |
'║ ║', | |
'╚═══╝'), | |
'dashed': ('┌┄┄┄┐', | |
'┊ ┊', | |
'┊ ┊', | |
'└┄┄┄┘'), | |
'rounddashed': ('╭┄┄┄╮', | |
'┊ ┊', | |
'┊ ┊', | |
'╰┄┄┄╯'), | |
} | |
def draw_box(shade, win, y=0, x=0): | |
for line in BOX[shade]: | |
win.insstr(y, x, line) | |
y += 1 | |
''' | |
┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ | |
│░░░│ │ │ │ │ │ │ │ │ | |
│░░░│ │ │ │ │ │ │ │ │ | |
└───┘ └───┘ └───┘ └───┘ └───┘ | |
┄┄┄┄┄┄┄┄┄┄┄┬┄┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┄ | |
┌───┐ ┌───┐┊┌───┐┊┌───┐ ┌───┐ | |
│ │ │ │┊│ │┊│ │ │ │ | |
│ │ │ │┊│ │┊│ │ │ │ | |
└───┘ └───┘┊└───┘┊└───┘ └───┘ | |
┄┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┄ | |
┌───┐ ┌───┐┊┌───┐┊┌───┐ ┌───┐ | |
│ │ │ │┊│███│┊│ │ │ │ | |
│ │ │ │┊│███│┊│ │ │ │ | |
└───┘ └───┘┊└───┘┊└───┘ └───┘ | |
┄┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┄ | |
┌───┐ ┌───┐┊┌───┐┊┌───┐ ┌───┐ | |
│ │ │ │┊│ │┊│ │ │ │ | |
│ │ │ │┊│ │┊│ │ │ │ | |
└───┘ └───┘┊└───┘┊└───┘ └───┘ | |
┄┄┄┄┄┄┄┄┄┄┄┴┄┄┄┄┄┴┄┄┄┄┄┄┄┄┄┄┄ | |
┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ | |
│ │ │ │ │ │ │ │ │ │ | |
│ │ │ │ │ │ │ │ │ │ | |
└───┘ └───┘ └───┘ └───┘ └───┘ | |
┌┄┄┄┐ | |
┊ ┊ | |
┊ ┊ | |
└┄┄┄┘ | |
╔═══╗ | |
║ ║ | |
║ ║ | |
╚═══╝ | |
┏━━━┓ | |
┃ ┃ | |
┃ ┃ | |
┗━━━┛ | |
╭┄┄┄╮ | |
┊ ┊ | |
┊ ┊ | |
╰┄┄┄╯ | |
''' | |
def main(stdscr): | |
curses.curs_set(False) | |
w = curses.newwin(4, 5, 0, 0) | |
w2 = curses.newwin(4, 5, 0, 5) | |
draw_box('light', w) | |
draw_box('dashed', w2) | |
w.refresh() | |
w2.refresh() | |
w.getkey() | |
stdscr.getkey() | |
if __name__ == '__main__': | |
curses.wrapper(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment