Git Product home page Git Product logo

music-playlist's Introduction

Prolog Music Playlist App

Overview

The Prolog program simulates a music playlist app, allowing users to create and manage custom playlists. Each playlist can contain multiple songs, and the program supports operations such as creating playlists, adding songs to existing playlists, and displaying the contents of a playlist.

Features

  • Create and manage playlists.
  • Add songs to playlists with details like title, artist, album, and year.
  • Display the list of songs in a playlist.
  • Rename playlists.
  • Delete playlists.

Prerequisites

To run this Prolog program, you need a Prolog interpreter installed on your machine. You can use popular Prolog interpreters such as SWI-Prolog.

Installation

  1. Clone the repository:

    git clone https://github.com/Vikranth3140/Music-Playlist.git
  2. Change directory to the music player:

    cd Music-Playlist
  3. Load the Prolog code in your Prolog interpreter:

    ?- [playlist].

Usage

  1. Creating a Playlist:

    To create a new playlist, use the playlist/2 predicate. For example:

    ?- playlist('My Playlist', []).

    This creates a playlist named 'My Playlist' with an empty list of songs.

  2. Adding a Song to a Playlist:

    To add a song to an existing playlist, use the add_song/4 predicate.

    ?- add_song('My Playlist', 'Song Title', 'Artist Name', UpdatedPlaylist).

    This adds a new song with the specified title and artist to the 'My Playlist' and returns the updated playlist in UpdatedPlaylist.

  3. Displaying a Playlist:

    To display the contents of a playlist, use the display_playlist/1 predicate.

    ?- display_playlist('My Playlist').

    This will show the name of the playlist and a list of songs.

  4. Renaming a Playlist:

    To rename the playlist, use the rename_playlist/1 predicate.

    ?- rename_playlist('Old Playlist', 'New Playlist').

    This will rename the name of the playlist.

  5. Deleting a Playlist:

    To delete the playlist, use the delete_playlist/1 predicate.

    ?- delete_playlist('My Playlist').

    This will delete the playlist.

Note

  • The program uses dynamic predicates to store playlist information.
  • The cut predicate is employed to prevent backtracking and ensure only one solution is found for each predicate call.
  • The fail predicate is used to explicitly fail a predicate and force backtracking in case of failure.
  • Lists are used to store songs in each playlist, and the append predicate is used to concatenate lists when adding a new song.

How to Contribute

Welcome to contribute to Prolog Music PLaylist App! Feel free to fork the repository and suggest any improvements. To contribute, follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push the changes to your fork.
  5. Submit a pull request.

Thank you for your contributions!

License

This project is licensed under the MIT License.

Author

Vikranth Udandarao

music-playlist's People

Contributors

vikranth3140 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

teckz0rd

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.