My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

This is a collection of my codes, usually for demonstrating algorithms and testing new stuffs.

You may follow me on Github

Random Fractal Terrain Generator

Screenshot

Online Demonstration: http://qiao.github.com/fractal-terrain-generator/demo/

Source: https://github.com/qiao/fractal-terrain-generator



Recursive 3D Tree Generation in WebGL

Screenshot

Online Demonstration: http://qiao.github.com/javascript-playground/webgl-tree/
Note:

  1. Make sure your browser supports WebGL (firefox/chrome/safari)
  2. This demo is highly CPU intensive and consumes considerable RAM. Do not try this if you have a RAM less than 2GB,

Source: https://github.com/qiao/javascript-playground/tree/master/webgl-tree




Visual Befunge93 Interpreter

This is an interactive befunge93 interpreter using HTML5's canvas.

See http://en.wikipedia.org/wiki/Befunge for the detailed explanation of the Befunge language.

Screenshot

Online Demonstration: http://qiao.github.com/javascript-playground/visual-befunge93-interpreter/

Note: Make sure your browser supports the HTML5 canvas tag (IE 8 and before doesn't);

Source: https://github.com/qiao/javascript-playground/tree/master/visual-befunge93-interpreter





Force-directed Layout

This is a graph drawing demo using Force-directed Layout.

Refer to the following links to see how the algorithm works.

  1. http://en.wikipedia.org/wiki/Force-based_algorithms_(graph_drawing)
  2. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.8444&rep=rep1&type=pdf

Screenshot

Source:
Requires Python 2.5+ and Pygame

http://mycodeplayground.googlecode.com/files/force-directed-layout-src.tar.gz




Fluid Simulation

The origin of this simulation is http://grantkot.com/MPM/Liquid.html (Written in Java)

And here's the Javascript version by Stephen Sinclair

And the Flash version by iunpin

I rewrote this simulation in C++/Qt4 and Python, based on the Javascript version given above.

Screenshot

C++/Qt4 Source:
http://mycodeplayground.googlecode.com/files/fluid.tar.gz

Python Source:
Requires Python 2.5+ and Pygame

http://mycodeplayground.googlecode.com/files/fluid.py

Note
The simulation in Python is not recommended since there're much fewer particles compared to those of the C++ version, due to the low performance of Python.

Yet Another Note
This program is only for demonstration; the source code is terribly unreadable.




Visual Sort 3D 0.1.0

A 3D visualizer of various sorting algorithms

This visualizer includes the following algorithms:

  1. Bubble Sort
  2. Cocktail Sort
  3. Odd-even Sort
  4. Comb Sort
  5. Gnome Sort
  6. Quick Sort
  7. Selection Sort
  8. Heap Sort
  9. Cycle Sort
  10. Insertion Sort
  11. Shell Sort

Screenshot

Source:
Requires Python 2.7 and VPython 5.0+ (http://vpython.org)

http://mycodeplayground.googlecode.com/files/visualsort3d-0.1.0-src.tar.gz


Flock Simulation

A flock simulator using Particle Swarm Optimization

Refer to http://en.wikipedia.org/wiki/Particle_swarm_optimization to see how the algorithm works.

Screenshot:

Source:
Requires Python 2.5+ and Pygame

http://mycodeplayground.googlecode.com/files/pso.tar.gz




Sudoku Solver

A Sudoku solver using Algorithm X and Dancing Links, techniques suggested by Donald E. Knuth.

Note: This program is only a solver; It's not playable. Feel free to modify it into a real game.

If you want to know more about the solving algorithm, refer to the following links. They will be helpful.

  1. http://www-cs-faculty.stanford.edu/~uno/papers/dancing-color.ps.gz
  2. http://en.wikipedia.org/wiki/Algorithm_X
  3. http://en.wikipedia.org/wiki/Dancing_Links
  4. http://sudopedia.org/wiki/Dancing_Links

Screenshot:

Source:
Requires Python 2.6+
The archive contains both GUI and CLI versions. Pygame is needed for the GUI.

http://mycodeplayground.googlecode.com/files/sudokusolver-src.tar.gz

Win32 Binary Distribution:

http://mycodeplayground.googlecode.com/files/sudokusolver-win32-dist.zip


Path Finding 0.1.1

A demo visualizing the execution of various path-finding algorithms

Curently five algorithms are included:

  1. A* (using Manhattan distance)
  2. A* (using Euclidean distance)
  3. A* (using Chebyshev distance)
  4. Dijkstra
  5. Bi-Directional Breadth-First-Search

This demo allows you to choose algorithms from above and visualize their execution.

Meanwhile, this is a Client/Server application. You should start the server first and then the client.
Also, you can start the server on one machine and run the client on a different machine, as long as the two machines are connected.

Screenshot:

Source:
Requires Python 2.6+ and Pygame

http://mycodeplayground.googlecode.com/files/pathfinding-0.1.1-src.tar.gz

Win32 Binary Distribution:

http://mycodeplayground.googlecode.com/files/pathfinding-0.1.1-win32-dist.zip

Note: There's a javascript version at http://qiao.github.com/PathFinding.js/visual/



Graham Scan

A demo of Graham Scan, a convex hull computing algorithm with time complexity O(n log n)

Refer to the following links to see how this algorithm works

  1. http://en.wikipedia.org/wiki/Graham_scan

Screenshot:

Source:
Requires Python 2.5+ and Pygame

http://mycodeplayground.googlecode.com/files/graham_scan.py

Powered by Google Project Hosting