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.
- 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).
- Puzzle Creation:
- Design Focus:
- Clean separation between simulation logic and presentation.
- Documentation with UML Class and Sequence Diagrams.
- Tools Used:
- Java & Maven (programmed using BlueJ as the IDE).
- BlueJ Documentation
- 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.
- Board Exchange:
- Design Focus:
- Extensibility: Preparing the codebase for future functionalities.
- Visual cues: Clear messages when an action cannot be performed.
- 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.
- Problem Resolution Simulation:
- 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).
- 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.
- Extended Tile Types:
- Additional Enhancements:
- Refactored the codebase into two packages:
shapes
(handling tile geometry and behavior) andpuzzle
(for the simulation logic). - Improved error handling with custom exceptions and logging.
- Enhanced visual representation for different tile and glue states.
- Refactored the codebase into two packages:
- Design Focus:
- Meeting full simulation requirements with a clear package structure.
- Updated UML documentation, including Package Diagrams, generated via Astah.
- 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.
- Normal Glue: Basic adhesion.
- Super Glue: Strong adhesive effect with adjacent tiles.
- Fragile Glue: Temporary adhesion for a single tilt action.
For further details about the development environment:
- BlueJ is used for building this project.
- You can check out the BlueJ Documentation for more 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:
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!