This project simulates a machine which consists of: 1. a tape, which stores bits (either a 1 or a 0) in sequential order, and 2. a head, which can: 2a. point to a specific position on the tape, 2b. read the bit at the position it points to, 2c. overwrite the bit at the position it points to, and 2d. move to the position immediately to the left or to the right of where it currently points. The machine follows two simple rules: 1. If the head reads a zero, it writes a one to its current position on the tape and then moves to the right. 2. If the head reads a one, it writes a zero to its current position on the tape and then moves to the left. When you begin the project, the tape is randomized, with each position having a 50% chance of containing a one, and a 50% chance of containing a zero. In theory, the tape can be any length (including infinitely long), but due to Scratch limitations the tape used in this project is only 200,000 bits long. This doesn't really affect things, as you could run this project for days and not even get close to either end. If you do reach the end, however, it will "loop around" to the opposite side. Note that this causes visual bugs (which would be easy to fix, but I'm lazy) From my (extremely limited) understanding, this is close to a Turing machine, but not quite one (even if you ignore the fact that the tape is of a finite length). It's still interesting to watch, though.
All code in this project is original. The machine itself only took about two minutes to code, but the display took over two hours! CHANGELOG: ------------ Ver 1.1 (14 March 2024): - Delay is now configurable (previously always set to 3) - Added ability to skip rendering - Rearranged UI, added instructions at bottom ------------ Ver 1.1.1 (15 March 2024) - Added version display - Added "." to character set ------------ Ver 1.2.0 (16 March 2024) - Added "range" to UI - Fixed visual bug with tape that caused some zeroes to appear as periods ------------ Ver 1.2.1 (17 March 2024) - Added block count to version display (currently 491)