Commit be559226 authored by The Heavy's avatar The Heavy 🚂
Browse files

curses

parent 23419e7b
Loading
Loading
Loading
Loading

plantmanager.py

100644 → 100755
+12 −1
Original line number Diff line number Diff line
#!/usr/bin/env python3

import time
import curses


class Plant:
    def __init__(self):
@@ -29,8 +31,13 @@ class Plant:
                self.height += 1
        return

if __name__ == "__main__":

def main(stdscr):
    plant = Plant()
    stdscr.clear()
    curses.noecho()
    curses.cbreak()
    stdscr.keypad(True)
    while plant.colour > -100:
        time.sleep(1)
        print(
@@ -38,3 +45,7 @@ if __name__ == "__main__":
                                                                      plant.colour))
        plant.grow()
    print("it died")
    return

if __name__ == "__main__":
    curses.wrapper(main)
 No newline at end of file