Skip to content

daev1005/Connections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Connections (Fundies 2 Project)

This project is a Java implementation of the Connections word game, inspired by the New York Times Connections puzzle.

It was built for Fundamentals of Computer Science II (Fundies 2) using the Big-Bang (impworld) library, the World Images library, and the Tester library for interactive programming and testing.

The design follows the functional programming style (no object-oriented classes beyond the required World), relying on immutable world states, event handlers, and rendering functions.


🎮 Gameplay

  • The game begins with 16 words arranged in a 4x4 grid.
  • The goal is to group the words into 4 categories of 4 words each.
  • Gameplay is the same as the New York Times version:
    • Select words you think belong together.
    • If your selection is correct (a full group of 4), the group is locked in.
    • Too many incorrect guesses, and you lose.
  • The game ends when:
    • You find all 4 correct groups (win 🎉), or
    • You run out of allowed mistakes (game over ❌).
image Screenshot 2025-10-02 224204 Screenshot 2025-10-02 224226

🛠️ How It Works

This program is written in Fundies 2 functional style using the following libraries:

  • javalib.impworld.* – Provides the World and big-bang loop for interactive programs.
  • javalib.worldimages.* – Provides shapes and text rendering (e.g., RectangleImage, TextImage, OverlayImage).
  • tester.* – For writing unit tests and verifying world transitions.
  • java.awt.Color – Standard color constants and custom RGB values.
  • java.util.*ArrayList, Arrays, and Random for managing word sets and shuffling.

Core components:

  • World state – stores the list of words, selected words, solved groups, and mistake count.
  • onMouseClicked – handles selecting/deselecting words.
  • onTick (optional, if used) – handles animations or timers.
  • makeScene – renders the current state (grid of words, mistakes left, solved categories).
  • end condition – checks whether the player has won or lost.

▶️ Running the Game

  1. Ensure you have the Fundies 2 libraries installed:

  2. Compile the file:

    javac Connections.java

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages