Giter Site home page Giter Site logo

Comments (17)

Lorretje avatar Lorretje commented on May 16, 2024 2

Related #88

  • Maybe get rid of the 'sort' name part in each algorithm. This would, I think, make the selection of algorithm more readable.
  • Else, make sure all algorithm names end with 't' (Some names may be too long to display?)

from sorting-algorithms-visualizer.

Mikhaylov-yv avatar Mikhaylov-yv commented on May 16, 2024 1

You can see my commit. 78c164c
My idea is melting:
If the data in display.sizeBox or display.algorithmBox is not correct. The egg color changes to red.
But I have one problem. I don't know how to change the color in the display.sizeBox.

from sorting-algorithms-visualizer.

Mikhaylov-yv avatar Mikhaylov-yv commented on May 16, 2024 1

Hey. I made the selection red, you can see it in my branch.
https://github.com/Mikhaylov-yv/Sorting-Algorithms-Visualizer/tree/error_checking

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024 1

@Mikhaylov-yv There are a lot to improve but i already did some changes! I rewrote the class for input boxes, especially in the method that updates the boxes values and I made the play button an instance of InputBox! The main.py is much cleaner to read, i hope :).
I made the seletion red as well, for that i just change the color atribute for the input boxes inside the error_checking function that you implemented!
I would appreciate if you could give me a feedback

from sorting-algorithms-visualizer.

Mikhaylov-yv avatar Mikhaylov-yv commented on May 16, 2024 1

@LucasPilla I believe this works great

from sorting-algorithms-visualizer.

prmurphy avatar prmurphy commented on May 16, 2024 1

When installing on Windows I get the following error.

C:\Users\steve\Sorting-Algorithms-Visualizer>pip install -r requirements.txt
Collecting pygame==1.9.6
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\steve\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame\setup.py'"'"'; file='"'"'C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\steve\AppData\Local\Temp\pip-pip-egg-info-0dd9hpg2'
cwd: C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame
Complete output (17 lines):

WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...


Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame\setup.py", line 194, in <module>
    buildconfig.config.main(AUTO_CONFIG)
  File "C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame\buildconfig\config.py", line 210, in main
    deps = CFG.main(**kwds)
  File "C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame\buildconfig\config_win.py", line 576, in main
    and download_win_prebuilt.ask(**download_kwargs):
  File "C:\Users\steve\AppData\Local\Temp\pip-install-hyaxeunf\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
    reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'c:\users\steve\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.

from sorting-algorithms-visualizer.

prmurphy avatar prmurphy commented on May 16, 2024 1

@LucasPilla It worked after I ran pip install pygame, which installed 'pygame-2.0.1-cp39-cp39-win_amd64.whl'. When trying to install from requirements.txt it attempted to intsall pygame-1.9.6.tar.gz which I really doubt works with windows. Thanks for the help.

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

I see your problem, I did the module for these input Boxes a time ago and there are a lot of harded code. When i have a time I will improve this module in a way that you can easily access the box properties, e.g. sizeBox.color = some_color.
By the way your idea is a simple and good way to alert errors.

from sorting-algorithms-visualizer.

egurnick avatar egurnick commented on May 16, 2024

It seems that display.py references the wrong folders for playButton and stopButton.
It references data/..
But should reference images/..

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

I forgot to change, thanks for remenbering
See if its working now

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

Thanks, there are some problems but the error alert is working! I still want to remake the code for input boxes so the code keeps clear and simple!

from sorting-algorithms-visualizer.

Mikhaylov-yv avatar Mikhaylov-yv commented on May 16, 2024

yes, it also seems to me that the code has become worse to read.

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

@prmurphy I think the problem is related to python and ygame versions that are not compatible.
Try installing pygame this way: pip install pygame and let me know if it worked.

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

@prmurphy Both ways, specifying or not the version, worked for me.
I am on Windows as well. Which version of python are you using?

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

@prmurphy Great! Thanks for reporting this error, as a temporary and simple solution i will remove the version specification from requirements.txt.

from sorting-algorithms-visualizer.

prmurphy avatar prmurphy commented on May 16, 2024

When you run bogosort, if you hit the 'stop' button the program freezes. I'm not exactly sure how the 'stop' button works, so I dont know what's causing this.

from sorting-algorithms-visualizer.

LucasPilla avatar LucasPilla commented on May 16, 2024

@prmurphy Actually the stop button stops the drawing, this makes the process faster.
Because bogosort is an "algorithm" extremely eneficient, it takes forever to finish.
I forgot to mention this issue, it could be fixed adding a flag to abort the algorithm.

from sorting-algorithms-visualizer.

Related Issues (20)

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.