Python Forum
How to animate a Turing Machine
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to animate a Turing Machine
#1
I want to depict a paper tape with ones and zeros scrolling past a read head "eye". I am little stuck on the design for this. I guess my first thought is to have a square object that can move left and right. One of these could look like a frame on a tape. That would mean drawing a square and writing a "0", etc.

An array of these could be made to move, by re-drawing (?) but I think it would get kinda choppy. Is there some other way to think about this. Is this a pygame Tkinter project? I would like some ideas on the best approach.

Also, would I be able to "draw" these frames off screen and then quickly run them past the read head. Maybe hundreds per second?
Reply
#2
You can do this with tkinter, but it's not trivial, use a canvas
you can simulate fade-in: https://stackoverflow.com/questions/2744...-animation
I would think you could get good results by overlaying two images, and vary transparency on up, other down over a set
time period.
Proper animation is an art
do a google image search to find images with: "paper tape" encoding
here's some reading material: https://www.python-course.eu/turing_machine.php
also investigate tkinter lift and lower (can have multiple Frames ready)
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020