Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Nov 7, 2020
0 parents commit da7cc72
Show file tree
Hide file tree
Showing 201 changed files with 25,842 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="lib" path="lib/classgraph-4.8.47.jar"/>
<classpathentry exported="true" kind="lib" path="lib/classgraph-4.8.47-javadoc.jar"/>
<classpathentry exported="true" kind="lib" path="lib/classgraph-4.8.47-sources.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.class
/bin/
28 changes: 28 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ArrayVisualizer-master</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1603996993926</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
15 changes: 15 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
2 changes: 2 additions & 0 deletions .settings/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.ui.text.custom_code_templates=
2 changes: 2 additions & 0 deletions .settings/org.eclipse.ltk.core.refactoring.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"mainClass": "main.ArrayVisualizer"
},
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": ["stable_checker:inplace_sort"]
}
]
}
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2019 w0rthy
Copyright (c) 2020 MusicTheorist

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
175 changes: 175 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# w0rthy's Array Visualizer, Revamped
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=Q5QLCFZ8G7WY6&currency_code=USD&source=url)

Over 75 sorting algorithms animated with 12 unique graphic designs

This new version of the program features additions inspired by Timo Bingmann's "The Sound of Sorting" and w0rthy's updates to the original visualizer.

To compile (After -cp, use ";" with Windows and ":" with Mac/Linux):
```
ant
java -cp bin;lib/classgraph-4.8.47.jar main.ArrayVisualizer
```
To build a runnable jar, simply run Apache Ant inside the 'dist' directory!

### Features:
- 40+ new sorting algorithms
- Updated visuals and sound effects
- You can select different array sizes now
- New shuffle types, including reversed, mostly similar numbers, almost sorted, and already sorted
- Skip Sort button
- Softer sounds toggle
- A real time in milliseconds estimate
- Toggle shuffle animation
- Toggle Timo Bingmann's "end sweep" animation
- Refactored / optimized code

## 6/8/2020 - Version 3.5
- NEW VISUALS: Sine Wave and Wave Dots!!
- New sort: Bogobogosort
- The bogo shuffle method is now unbiased
- MultipleSortThreads further refactored
- Visuals, VisualStyles enum, and Renderer significantly refactored (more to come!)

## 6/4/2020 - Version 3.2
- New sort: Optimized Cocktail Shaker Sort
- Significant refactoring for MultipleSortThreads and RunAllSorts
- "Run All" button approx. time simplified
- Modified delays for Binary Gnomesort
- Documentation of GCC's median-of-three pivot selection in Introsort

## 6/3/2020 - Version 3.12
- Counting Sort fixed
- Optimized Bubblesort now optimized for already sorted inputs
- Speeds for Quicksorts and Weave Merge during "Run All Sorts" improved

## 6/2/2020 - Version 3.11
- Minor update to MIT license
- Fixed typo in Flipped Min Heapsort
- Improved highlights on Heapsorts (Already sorted heaps now display redundant comparisons)
- Bug fix for Patiencesort on reversed arrays
- Quicksorts exhibiting worst-case behavior during "Run All Sorts" run much faster
- Same tweak as above to Weave Merge Sort

## 5/30/2020 - Version 3.1
- Error messages with detailed information will now appear within the program!
- Sound effects are now consistent on all platforms
- New sort: "Flipped Min Heap Sort" by 'landfillbaby'!
- Minor changes to code organization
- New webhook to my Discord server! Check it out here: https://discord.com/invite/2xGkKC2

## 5/22/2020 - Version 3.01
- Quick bug fix to the "Linked Dots" visual;
The first line is no longer horizontal.

## 5/21/2020 - Version 3.0 is now released!
- Sound effects are much more pleasant at slower speeds
- Revamped "Run All Sorts" (It is now easier to create your own sequence of sorts!)
- More accurate delay algorithm
- Improved random shuffle algorithm (now with 0% bias!)
- Cleaner statistics
- Sort an array up to 16,384 (2^14) numbers!
- The "green sweep" animation also verifies an array is properly sorted after watching a sort.
If a sort fails, a warning message pops up, highlighting where the first out-of-order item is.
- Minor tweak to the sort time method. It should be a slight bit more accurate now.
- Slowsort and Sillysort's comparisons are now shown.
- Gravity Sort has a more detailed visual now
- Pancake Sorting is fixed
- Counting Sort is fixed
- Holy Grail Sort is enabled, but just note that it's a mock algorithm; not finished yet.
- "Auxillary" typo fixed; program now says 'Writes to Auxiliary Array(s)'
- Bug fixes and minor tweaks
- Minor fixes to "Skip Sort" button
- Weird static line bug with linked dots squashed
- Other miscellaneous fixes and changes here and there

## 10/19/2019 - Version 2.1
- Both Odd-Even Mergesorts now display comparisons
- PDQSort's Insertion Sorts have been slowed down
- New sorts, courtesy of Piotr Grochowski (https://github.com/PiotrGrochowski/ArrayVisualizer):
- Iterative Pairwise Sorting Network
- Recursive Pairwise Sorting Network
- Recursive Combsort

## 10/13/2019 - Version 2.0 is now released!
- Now includes 73 sorting algorithms, with 2 more that will be finished in the future
- NEW SORTS:
- Unoptimized Bubble Sort
- Rotation-based In-Place Merge Sort
- "Lazy Stable Sort" from Andrey Astrelin's GrailSort
- Grail sorting with a static buffer
- Grail sorting with a dynamic buffer
- Andrey Astrelin's "SqrtSort"
- CircleSort
- Introspective CircleSort
- Orson Peters' "Pattern-Defeating Quicksort" (PDQSort)
- Branchless PDQSort
- Morween's implementation of "Poplar Heapsort"
- Recursive Binary Quicksort
- Iterative Binary Quicksort
- Iterative Bitonic Sort
- Iterative Odd-Even Mergesort
- "Bubble Bogosort"
- "Exchange Bogosort"
- Treesort
- Optimized Gnomesort with Binary Search
- "Cocktail Mergesort" (https://www.youtube.com/watch?v=fWubJgIWyxQ)
- NOTE: "Quick Shell Sort" has been removed.
- Significantly refactored code, more object-oriented
- Optimized visuals -- the program runs smoother than ever!
- Plug-and-play functionality -- using classgraph, you can now easily add your own sorting algorithms to the program! Documentation on that will be available in the future.
- Sort delay system redesigned -- you can now change the speed of the program in the middle of a delayed compare or swap
- Speed dialogue is now disabled while other windows are open
- WikiSort no longer gets stuck on sorting its internal buffer
- Tweaks to TimSort, mostly reimplementing its binary insertion sort
- Binary Insertion Sort is now stable
- The write/swap counts for inputs already sorted are fixed
- The main/auxillary array write counts for Bottom-up Merge are fixed
- Shuffling the array now clears the statistics
- The highest pitches of the program's sound effects are fixed
- Speeds for the "green sweep" and shuffling animations have been tweaked
- Shatter Sort's highlights slightly tweaked
- GrailSort's highlights slightly tweaked

**KNOWN BUGS:**
- Certain sorts (comb sort, radix sorts) cause the program to forget the current speed
- Certain sorts do not work with the "Skip Sort" button
- Missing soundfont
- SkaSort and HolyGrailSort produce errors -- this is normal, they aren't finished yet
- No circular pointer -- will be fixed soon

**PLANS FOR FUTURE RELEASES:**
- Javadocs!!
- SkaSort
- "Holy Grail Sort"
- Options to:
- Enter in your own set of numbers
- Select CombSort gap sequence
- Select ShellSort gap sequence
- Change TimSort "minrun" value
- Change IntroSort threshold for insertion/heap sort
- Change Simple Shatter Sort rate(?)
- Stop Run All Sorts(?)
- Stop TimeSort(?)
- Pre-shuffled arrays
- Organize list of sorts into more categories
- Run All Sorts in specific category
- Subheadings for customizable sorts (e.g. display the number of buckets during a bucket sort)
- "Many Similar" distribution ((i/5) * 5, as an example)
- "Pipe organ" distribution (half ascending, half descending)
- Fixed circular pointer with much cleaner math
- Toogle between pointer and black bar with circular visuals
- Refactor/reorganize prompts and frames
- Cleaner:
- Tree Sort
- getters/setters
- method parameters
- Small organizational changes

**If you are experiencing performance issues in Windows 10, look here: https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display**

An executable .jar file is available in the dist folder. Have fun!

Videos this program is featured in:

https://www.youtube.com/playlist?list=PL5w_-zMAJC8tSgmfaltMMj7Kn390eRzMq
Binary file added __pycache__/stable_checker.cpython-38.pyc
Binary file not shown.
79 changes: 79 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="ArrayVisualizer-master">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<path id="ArrayVisualizer-master.classpath">
<pathelement location="bin"/>
<pathelement location="lib/classgraph-4.8.47.jar"/>
<pathelement location="lib/classgraph-4.8.47-javadoc.jar"/>
<pathelement location="lib/classgraph-4.8.47-sources.jar"/>
</path>
<path id="run.ArrayVisualizer.classpath">
<path refid="ArrayVisualizer-master.classpath"/>
<pathelement location="lib/classgraph-4.8.47.jar"/>
<pathelement location="lib/classgraph-4.8.47-javadoc.jar"/>
<pathelement location="lib/classgraph-4.8.47-sources.jar"/>
</path>
<path id="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER.libraryclasspath"/>
<path id="run.Main.classpath">
<path refid="ArrayVisualizer-master.classpath"/>
<path refid="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER.libraryclasspath"/>
</path>
<path id="run.Tester (2).classpath">
<path refid="ArrayVisualizer-master.classpath"/>
<path refid="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER.libraryclasspath"/>
</path>
<path id="run.Tester.classpath">
<path refid="ArrayVisualizer-master.classpath"/>
<path refid="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER.libraryclasspath"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="ArrayVisualizer-master.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target name="ArrayVisualizer">
<java classname="main.ArrayVisualizer" failonerror="true" fork="yes">
<classpath refid="run.ArrayVisualizer.classpath"/>
</java>
</target>
<target name="Main">
<java classname="main.Main" failonerror="true" fork="yes">
<classpath refid="run.Main.classpath"/>
</java>
</target>
<target name="Tester (2)">
<java classname="test.Tester" failonerror="true" fork="yes">
<classpath refid="run.Tester (2).classpath"/>
</java>
</target>
<target name="Tester">
<java classname="javagrailsort.Tester" failonerror="true" fork="yes">
<classpath refid="run.Tester.classpath"/>
</java>
</target>
</project>
Loading

0 comments on commit da7cc72

Please sign in to comment.