Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Twiddle

If you have a Chatgpt account you can play online here: https://twiddle-game.jimerb.chatgpt.site

A browser port of Twiddle, a two-player strategy game originally published as a type-in BASIC listing for the Commodore 128 in Run Magazine, February 1987.

Play it by opening twiddle.html in any modern browser — no build step, no server, no dependencies.

Original listing: Run Magazine, Issue 38 (1987-02), page 78 via the Internet Archive.

Play it

Just download twiddle.html and double-click it, or clone the repo and open the file directly:

git clone https://github.com/jimerb/Twiddle.git
cd Twiddle

Then open twiddle.html in your browser.

The game

Twiddle is played on a square grid (3×3 up to 6×6). Player 1's pieces (squares) start on the top row; Player 2's pieces (diamonds) start on the bottom row. The goal is simple: capture every one of your opponent's pieces.

Every square on the board carries one to four arrows that determine the only directions a piece sitting there may move — up, down, left, or right, never diagonally. Moving off an edge wraps around to the opposite side if the arrows allow it.

The twist: when a piece leaves a square, that square's arrows rotate 90° clockwise. The board rewrites itself under you with every move, so a path that's open now may be closed — or a new one may open — the next time someone passes through. You can even spend a move "twiddling" a piece in place just to rotate the arrows under it, without moving anywhere.

A turn is three moves (configurable), split however you like among your pieces. If 15 turns pass with no capture, the number of moves per turn increases, making it progressively harder to stay out of reach.

Full rules, strategy notes, and an explanation of the more subtle mechanics (like the home-row wraparound lockout) are built into the game itself — click the How to play button.

Features in this port

  • Faithful reimplementation of the original BASIC logic: arrow bitmasks, clockwise rotation, wrap-around adjacency, the home-row wraparound lockout, and the capture-drought move escalation
  • Tap-to-move, with legal destinations and captures highlighted on the board
  • Visual cues for mechanics the original left to the player to infer: selecting a piece glows and isolates its own square's arrows from the rest of the board, and a lock badge marks home-row squares that still block wraparound (with a log message when a row fully unlocks)
  • Full game-setup screen exposing every parameter the original article told you to hand-edit into the BASIC source (board size, moves per turn, arrow rotation mode, wraparound rule, capture-drought threshold)
  • Optional computer opponent (simple heuristic — takes free captures, avoids hanging pieces) for solo play, or hot-seat for two players at one keyboard
  • Four themes (Classic '87, Walnut, Neon, Slate), move log, undo, move animations, and sound effects
  • Responsive: side-by-side on a wide screen, stacked on a phone
  • One plain HTML file with no build step and no libraries — open it locally and it runs. It pulls two web fonts from Google Fonts when online, and falls back to system fonts when not.

Credits

  • Original game design and BASIC 7.0 program: Run Magazine, February 1987
  • This port: an OCR-derived transcript of the original listing (Twiddle.md) was used to reconstruct the exact game logic, then reimplemented from scratch in JavaScript

License

The original 1987 program and article belong to their original publisher. This port is shared for personal, educational, and nostalgic use. Magazine that inspired the game: https://archive.org/details/run-magazine-38/page/n77/mode/2up

About

A browser port of Twiddle, a 1987 Run Magazine type-in BASIC game for the Commodore 128

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages