Giter VIP home page Giter VIP logo

meuler's Introduction

Meuler

Order algorithm plotter

image GIF Meuler

Meuler is a Java-based project that allows you to visualize the performance of data sorting algorithms, such as the popular algorithm "Bubble", Quicksort, among others.

Clone repository

$ git clone git://github.com/joalcapa/Meuler.git

$ cd Meuler

Compilation of Meuler

Compilation of the project, using the file containing the main method, in order to generate the necessary ".class" files to execute Meuler without the ".jar", remember to add the jdk of java, to the environment variables, to recognize the command "javac".

$ javac meuler/Meuler.java

Execute Meuler

$ java meuler/Meuler

Rendering

Basically Meuler, gives the rendering power to DaVinci, so an array is drawn on the screen.

@Override
    public void paint(Graphics g){
        super.paint(g);
        int accountant = 0, accountantMinux;
        for (int i = 0; i < 179; i++) {
            accountant+=5;
            accountantMinux = accountant - 1;
            g.setColor(new Color(0, 204, 255));
            g.drawLine(accountant, (200-arrayData[i]), accountant, 200);
            g.setColor(Color.white);
            g.drawLine(accountant, ((200-arrayData[i])-4),accountant, (200-arrayData[i]));
            g.setColor(new Color(0, 204, 255));
            g.drawLine(accountantMinux, (200-arrayData[i]), accountantMinux, 200);
            g.setColor(new Color(0, 204, 255));
            g.drawLine(accountantMinux, ((200-arrayData[i])-4), accountantMinux, (200-arrayData[i]));
        }
    }

Prosecution of the data

For algorithm processing, Meuler gives AlgorithmHandler the processing power, is able to process the array, and instruct DaVinci to render the change.

for (int i = 1; i < 179; i++) {
            aux = daVinci.getDataIndex(i);
            k = i-1;
            while( k >= 0 && aux < daVinci.getDataIndex(k)) {
                daVinci.setDataIndex((k+1), daVinci.getDataIndex(k));
                k--;
                try { Thread.sleep(1); } catch (InterruptedException ex) {
                    Logger.getLogger(AlgorithmHandler.class.getName()).log(Level.SEVERE, null, ex);
                }
                daVinci.repaint();    
            }
            daVinci.setDataIndex((k+1), aux);    
            try { Thread.sleep(1); } catch (InterruptedException ex) {
                Logger.getLogger(AlgorithmHandler.class.getName()).log(Level.SEVERE, null, ex);
            }
            daVinci.repaint();
        } 
        isFinalize = true;
        thread = null;

meuler's People

Contributors

joalcapa avatar

Watchers

James Cloos 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.