Skip to content

A Java-based project from the POOB course that simulates the ICPC “Tilting Tiles” puzzle. It models tile movement on a board with sticky “gummy glue” mechanics and supports multiple tile and glue types. Built iteratively with a focus on modular design and puzzle solving.

Notifications You must be signed in to change notification settings

AnderssonProgramming/Puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tilting Tiles Simulator — ICPC Problem F

Tilting Tiles Simulator is developed as part of the POOB (Object-Oriented Programming) course at Escuela Colombiana de Ingeniería Julio Garavito. The simulator is inspired by Problem F: "Tilting Tiles" from the 47th ICPC World Finals (Luxor 2023). It aims to mimic a tilting board puzzle where colored tiles move based on the direction of the tilt, with an added twist: a special adhesive called gummy glue that makes a tile stick with its neighbors.

Note: This project solves the original ICPC problem. It is built in iterative cycles, with new features and refinements introduced at each stage.


🚀 Project Development Cycles

Cycle 1: Basic Simulator and Initial Tile Manipulation

  • Objective: Build a functional simulator for tilting the puzzle.
  • Key Features:
    • Puzzle Creation:
      • Create a puzzle board based on provided dimensions or preset configurations.
    • Tile Management:
      • Add, relocate, or delete individual tiles.
    • Glue Application:
      • Introduces the first version of a glue mechanism that can be applied over a tile.
    • Basic Board Tilting:
      • Simulate tilts in the four cardinal directions (left, right, toward, and away).
    • State Verification:
      • Compare the current board state with a target configuration.
    • User Interaction:
      • Enable the simulator to be visible (so messages are shown) or invisible (for background processing).
  • Design Focus:
    • Clean separation between simulation logic and presentation.
    • Documentation with UML Class and Sequence Diagrams.
  • Tools Used:

Cycle 2: Enhanced Board Interaction and Additional Commands

  • Objective: Extend the simulator with additional commands and refine board interaction.
  • Key New Features:
    • Board Exchange:
      • Ability to swap the reference board with the current editing board.
    • Intelligent Tilting:
      • Improved tilt functionality that better simulates natural movement.
    • Hole Creation:
      • Command to “make a hole” in an empty cell.
    • Consultation Enhancements:
      • Identify and highlight tiles that cannot be moved when tilting.
      • Display the number of tiles missing to meet a target configuration.
  • Design Focus:
    • Extensibility: Preparing the codebase for future functionalities.
    • Visual cues: Clear messages when an action cannot be performed.

Cycle 3: Simulation of Puzzle Resolution

  • Objective: Extend the simulator to both mimic and solve the tilting puzzle.
  • Key New Features:
    • Problem Resolution Simulation:
      • Implement a routine that simulates a potential solution path from the initial to the desired final state.
      • Step-by-step illustration of tile movements.
    • User Feedback:
      • Detailed messages indicating whether a solution was found or if no solution exists.
  • Design Focus:
    • Separation of concerns: The core Puzzle class is used solely for simulation, while the resolution logic is modular.
    • Transparent simulation output (each tilt is shown as a step).

Cycle 4: Final Refactoring and Extension

  • Objective: Polish the simulator and introduce new tile and glue types.
  • Key New Features:
    • Extended Tile Types:
      • Normal Tile: Standard, movable tile.
      • Fixed Tile: Cannot be relocated or removed.
      • Rough Tile: Resistant to sliding.
      • Freelance Tile: Ignores glue adhesion.
      • Flying Tile: Does not fall into holes.
    • Extended Glue Types:
      • Normal Glue: Basic adhesive effect.
      • Super Glue: Causes a tile and its adjacent tiles to stick strongly.
      • Fragile Glue: Adhesion lasts only for a single tilt.
  • Additional Enhancements:
    • Refactored the codebase into two packages: shapes (handling tile geometry and behavior) and puzzle (for the simulation logic).
    • Improved error handling with custom exceptions and logging.
    • Enhanced visual representation for different tile and glue states.
  • Design Focus:
    • Meeting full simulation requirements with a clear package structure.
    • Updated UML documentation, including Package Diagrams, generated via Astah.

📝 Summary of Simulator Components

Tiles:

  • Normal Tile: Moves with every tilt.
  • Fixed Tile: Cannot be relocated or eliminated.
  • Rough Tile: Resistant to sliding.
  • Freelance Tile: Does not adhere when glue is applied.
  • Flying Tile: Avoids falling into holes.

Glue Types:

  • Normal Glue: Basic adhesion.
  • Super Glue: Strong adhesive effect with adjacent tiles.
  • Fragile Glue: Temporary adhesion for a single tilt action.

📸 Project View

  • Design image

  • Empty constructor image

  • Starting and ending constructor with different types of tiles and glues image

  • Ending constructor image

  • ICPC Problem image image image

📚 Additional Information & Documentation

For further details about the development environment:

  • BlueJ is used for building this project.
  • You can check out the BlueJ Documentation for more information.

📧 Questions & Further Information

If you have any questions regarding the project requirements or need additional details about how the simulator was developed, please reach out via email:

[email protected]


This repository is a work in progress, built iteratively across multiple cycles to simulate and eventually solve the tilting tiles puzzle. Each development cycle added new commands and refined the simulation, with a focus on clear design, modularity, and extensibility.

Happy coding and enjoy experimenting with the puzzle simulation!

About

A Java-based project from the POOB course that simulates the ICPC “Tilting Tiles” puzzle. It models tile movement on a board with sticky “gummy glue” mechanics and supports multiple tile and glue types. Built iteratively with a focus on modular design and puzzle solving.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages