GithubHelp home page GithubHelp logo

memgonzales / sliding-puzzle Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 7.0 19.57 MB

8-puzzle game that features a walkthrough of the optimal solution and allows users to customize the tiles using photos from their Gallery

Home Page: https://memgonzales.github.io/sliding-puzzle

Kotlin 100.00%
8-puzzle 8-puzzle-solver a-star manhattan-distance heuristics pathfinding informed-search android mobile-development kotlin

sliding-puzzle's Introduction

8-Puzzle (Sliding Puzzle)

badge badge badge badge
badge Actions Status Actions Status

8-Puzzle is a sliding puzzle game that features a walkthrough of the optimal solution and allows users to customize the tiles using photos selected from their Gallery. In finding the optimal path from the current puzzle state to the goal state, the system employs the informed search algorithm A* and uses Manhattan distance as an admissible and consistent heuristic to estimate the cost.

Inspired by an exercise in our Mobile Development class, I started creating this app during our university break, after finishing my second year of undergraduate studies. As one of my first personal projects, working on this was an opportunity to synthesize concepts and practices that I learned from our sophomore courses, such as:

  • Exploration of language features (Advanced Programming and Theory of Programming Languages)
  • Program optimization (Algorithms and Complexity)
  • Artificial intelligence and search algorithms (Introduction to Intelligent Systems)
  • Quality assurance and unit testing (Introduction to Software Engineering)

This project also utilizes a continuous integration/continuous delivery (CI/CD) pipeline โ€” which is the focus of our third-year class Advanced Software Engineering.

The API documentation can be viewed at https://memgonzales.github.io/sliding-puzzle/

Project Structure

The project consists of the following folders:

Folder Description
.github Contains the YML files defining the workflows that are included in the CI/CD pipeline
.idea Contains files used by Android Studio to load project-specific configurations
app Contains all the source code and resource files, the markdown file for the app- and package-level documentation, and files defining the module-specific dependencies, project-specific ProGuard rules, and developer credentials related to Google services
gradle Contains files used by Gradle to run build automation tasks

Several Gradle-related files are also included in its root directory.

Running the Application

The minimum SDK supported is Android Lollipop (API Level 21), and the target SDK is Android 11 (API Level 30).

Using the APK

Download and install the APK file from the latest release. You may have to modify the security settings of your device to allow the installation of third-party apps from unknown sources.

App Screenshots

Using the Source Code

  1. Create a copy of this repository:

    • If git is installed, type the following command on the terminal:

      git clone https://github.com/memgonzales/sliding-puzzle
      
    • If git is not installed, click the green Code button near the top right of the repository and choose Download ZIP. Once the zipped folder has been downloaded, extract its contents.

  2. Run the app using Android Studio (or any IDE that supports Android development). Alternatively, Android also provides a guide on how to build the app from the command line.

    Walkthrough of Optimal Solution

Dependencies

This project uses the following project dependencies:

Dependency Version Description License
com.android.tools.build:gradle 4.2.2 Gradle build automation tool Apache License 2.0
org.jetbrains.kotlin:kotlin-gradle-plugin 1.5.0 Gradle plugin for Kotlin/JVM compilation tasks Apache License 2.0
org.jetbrains.dokka:dokka-gradle-plugin 1.5.0 Gradle plugin for Dokka documentation engine Apache License 2.0
com.google.gms:google-services 4.3.10 Plugin for processing the google-servies.json file Apache License 2.0

It also uses the following module-specific dependencies:

Dependency Version Description License
org.jetbrains.kotlin:kotlin-stdlib 1.5.0 Kotlin standard library for JVM Apache License 2.0
androidx.core:core-ktx 1.6.0 Core module providing Kotlin extensions for common framework APIs and several domain-specific extensions Apache License 2.0
androidx.appcompat:appcompat 1.3.1. Library allowing access to new APIs on older API versions of the platform Apache License 2.0
com.google.android.material:material 1.4.0 Library for using APIs that provide implementations of the Material Design specification Apache License 2.0
androidx.constraintlayout:constraintlayout 2.1.1 Library for positioning and sizing widgets in a flexible way with relative positioning Apache License 2.0
junit:junit 4.13.2 Unit testing framework for Java Eclipse Public License 1.0
androidx.test.ext:junit 1.1.3 AndroidX unit testing framework for Java Eclipse Public License 1.0
Apache License 2.0
androidx.test.espresso:espresso-core 3.4.0 Framework for writing Android user interface tests Apache License 2.0

The descriptions are taken from their respective websites.

Built Using

This project uses the following languages and technologies:

  • Logic: Kotlin, a statically typed language endorsed by Google as the preferred language for Android development
  • Layouts: XML, a lightweight markup language that is both human- and machine-readable

GitHub Actions serves as the CI/CD platform for automating these workflows (triggered by a push or pull request):

  • Linting, testing, and building the APK
  • Generating the HTML version of the API documentation from KDoc comments via Dokka
  • Publishing the API documentation with GitHub Pages

Author

Assets (such as images and XML resource files) are properties of their respective owners. Attribution is found in the credits file. Technical references used in the implementation of algorithms are cited in the API documentation of the pertinent methods.

sliding-puzzle's People

Contributors

memgonzales avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.