Engineering Lab

UCT CSC2002 / 2022

Words in motion

A falling-word typing game coordinating animated words, keyboard input and score updates.

JavaSwingThreadsCountDownLatch

UCT / COURSE CONTEXT / 2022

CSC2002S · Computer Science 2002

Concurrent programming, computer architecture and interface design, with Java and assembler practicals.

Science handbook · 2022
Actual source-built Swing typing tutor, showing its original idle screen and score/pause controls
Actual source-built Swing typing tutor, showing its original idle screen and score/pause controls

ENGINEERING PERSPECTIVE

Inside the work

Coordinate animation and input in a small concurrent interface. Falling words, typed matches and score changes make lifecycle state and thread coordination observable.

Java / CountDownLatch
Word threads wait for a shared start; atomic flags coordinate pause and completion.
Swing / keyboard input
Display and score updates connect visual state to typed-word handling.
STEP 1 / 3

Release the words

Mover threads wait for the common start condition.

Source-derived walkthrough

How it works

WordMover threads wait on a shared start latch, CatchWord threads respond to typed words, and shared atomic flags coordinate start, pause and completion. A separate display and score updater refresh the Swing interface.

Results & recovery

  • The intact eight-class submission compiles with JDK 17.
  • The original GUI was launched and captured; its university-era interface is preserved.

Technical limitations

The outer FallingWord.java contains unrelated Python text. The nested Java version is intact. Recovery verifies the GUI, not a comprehensive thread-safety or gameplay test.

What I would improve now

Consolidate duplicate versions, test pause/restart races and marshal UI changes through SwingUtilities.

NEXT IN THE ARCHIVEInside a shortest-path search