--- title: "Wink" id: 57332 type: "computer_media" slug: "wink" url: "http://localhost/computer_media/wink/" markdown_url: "http://localhost/computer_media/wink.md" published_at: "2024-10-04T08:21:05+00:00" modified_at: "2026-03-30T21:18:33+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/09/180_Wnk.png" excerpt: "A three-frame ASCII face blinks and opens its mouth in a tight animation loop, using FOR–NEXT timing and a clever border design." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" genre: - name: "Demo" slug: "demo" taxonomy: "genre" url: "http://localhost/type/demo/" media_contents: - id: 56735 title: "Timex Sinclair Public Domain Library Tape 1004" type: "computer_media" url: "http://localhost/computer_media/timex-sinclair-public-domain-library-tape-1004/" media_type: "Program" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/09/180_Wnk.png" media_type_tags: "Demo" --- # Wink This program displays a simple animated face constructed entirely from ASCII-style characters, cycling through three frames in a continuous loop. Each frame is drawn inside a border of asterisks and parentheses, with the face alternating eye and mouth states to suggest blinking and an opening mouth. The delay between frames is achieved using a short FOR–NEXT loop from 1 to 10, a common timing technique on machines without a dedicated delay command. The animation loops indefinitely via a GOTO at line 280 returning to the start. *** ## Program Analysis ### Program Structure The program is divided into three nearly identical blocks, each occupying roughly 90 lines of code. Every block clears the screen, prints an eight-row bordered face, then pauses using a short `FOR`–`NEXT` loop before the next block begins. After the third frame, `GOTO 10` at line 280 restarts the cycle indefinitely. | Block | Lines | Eyes | Mouth | | --- | --- | --- | --- | | Frame 1 | 10–95 | (O) (O) | — | | Frame 2 | 100–185 | (O) (-) | O | | Frame 3 | 190–275 | (O) (O) | O | ### Animation Logic The animation mimics a winking or blinking sequence. Frame 1 shows both eyes open with a closed mouth (`---`). Frame 2 changes the right eye to a closed dash (`-`) and opens the mouth to an `O`. Frame 3 returns both eyes to open while keeping the mouth as `O`. This three-step cycle creates a subtle wink-and-speak effect. ### Timing Mechanism Each frame uses a `FOR X=1 TO 10 ... NEXT X` loop split across two lines (e.g. lines 90 and 95) purely as a software delay. The loop body is empty, so it simply burns CPU cycles. The delay is very short — only 10 iterations — which on a machine of this era produces a rapid animation rather than a slow one. ### Key BASIC Idioms - Splitting `FOR` and `NEXT` across adjacent line numbers (e.g. 90/95, 180/185, 270/275) is a stylistic choice with no functional difference from a single-line loop. - Each frame reuses the same border string `"()***********()"`, making the outer frame consistent across all three states. - `GOTO 10` rather than `GOTO VAL "10"` is used for the infinite loop, which is straightforward but slightly less memory-efficient than the `VAL` idiom. ### Anomalies and Notes Lines 290 and 300 (`SAVE "1018%0"` and `RUN`) appear at the end of the listing but are never reached during execution because the `GOTO 10` loop at line 280 never exits. These lines exist outside the runtime flow and serve a purpose unrelated to the animation itself. The variable `X` is shared across all three delay loops, but since each loop runs to completion before the next begins, there is no conflict. After each loop, `X` holds the value 11, but this is never read. ## Source Code ``` 10 CLS 20 PRINT "()***********()" 30 PRINT "** **" 40 PRINT "** (O) (O) **" 50 PRINT "** **" 60 PRINT "** V **" 70 PRINT "** **" 80 PRINT "** --- **" 90 FOR X=1 TO 10 95 NEXT X 100 CLS 110 PRINT "()***********()" 120 PRINT "** **" 130 PRINT "** (O) (-) **" 140 PRINT "** **" 150 PRINT "** V **" 160 PRINT "** **" 170 PRINT "** O **" 180 FOR X=1 TO 10 185 NEXT X 190 CLS 200 PRINT "()***********()" 210 PRINT "** **" 220 PRINT "** (O) (O) **" 230 PRINT "** **" 240 PRINT "** V **" 250 PRINT "** **" 260 PRINT "** O **" 270 FOR X=1 TO 10 275 NEXT X 280 GOTO 10 290 SAVE "1018%0" 300 RUN ```