.txt file with frames of ASCII art each separated by a
\n (see this example if you are unclear) output a motion picture with frame with 1 frame per second.
Note that there is a trailing
\n on the final frame.
Each frames dimensions will be:
- The Previous frame must be cleared before the next is displayed, so just printing each frame onto the terminal isn't a valid answer.
- New You can grab the file name however you want, either from it being stored in a variable or from sys args.
- New The images must Loop indefinitely
- This is code golf: smallest program wins.
0 0 0 0 00000 0 0 0 0 00000 0 00000 0 00000 0 0 0 0 0 0 0
import curses, time stdscr = curses.initscr() Frames = file.read(file('Frames.txt')).split('\n') while True: y = 0 for i in range(len(Frames)): stdscr.addstr(y,0,Frames[i]) stdscr.refresh() y += 1 if Frames[i] == '': y = 0 stdscr.clear() time.sleep(1)