Skip to content
المشاريع

o-reo/push_swap_visualizer

عرض على GitHub

حول

أداة واضحة لتصور خوارزمية Push Swap؛ فلا يمكنك إصلاح ما لا تراه!

التعلّم والتعليم

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
+١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Push Swap Visualizer

This project is a visualizer for the "PUSH_SWAP" 42 School Project.

Push Swap is a program that takes as argument a space separated list of numbers and outputs a list of commands that can be used to sort them.

You can read the subject here.

Install

  • Clone the push_swap_visualizer repository into the directory where your push_swap project is located:
git clone https://github.com/o-reo/push_swap_visualizer.git

This project uses C++17, cmake, SFML and ImGui.

  • Install required packages (if not already installed) For Debian-based systems, you can install the necessary packages using the following commands:
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install g++
sudo apt-get install clang
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libx11-dev libxrandr-dev
sudo apt-get install libudev-dev
sudo apt-get install libfreetype-dev
  • Navigate to the push_swap_visualizer directory, create build directory, and navigate into the build directory:
cd push_swap_visualizer
mkdir build
cd build
  • Generate the build files using CMake and compile the visualizer:
cmake ..
make
  • Run the visualizer:
./bin/visualizer

Usage

  • If you've relocated your push_swap program, simply update the visualizer's menu directory from "../../push_swap" to the new path of your push_swap program. For instance, "../../new_directory/push_swap".

  • In the Values window

    • Choose the size of the push swap input with the slider [Optional]
    • Shuffle the input [Optional]
    • The space separated values should be filled automatically, you can also put your own values
    • Set the Push Swap program path (Absolute or relative path).
    • Compute the sort commands, it will display OK when done.
  • In the Controls window

    • Load the commands in the visualizer
    • Start the animation
    • Adjust the Speed as needed
    • Pause and go Step by step to see the details of your algorithm.
    • Load to restart the animation

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…