Permalink
Browse files

Added readme.

  • Loading branch information...
1 parent 726e343 commit 8bd1c6cb3e60dfd45b2f888a0f7eb6b8dc6a7498 @Dolkar committed Oct 6, 2011
Showing with 18 additions and 3 deletions.
  1. +14 −0 README.txt
  2. +4 −3 shunting.py
View
@@ -0,0 +1,14 @@
+A bunch of random stuff I made which, I hope, will be helpful to someone... somewhere...
+
+gifsurface - Support for animated gifs in pygame.
+
+pathfind - A pathfinding algorithm using A*. Not well documented.
+I use it in the google AI challange (Ants)
+
+prime_eff - A pretty efficient way to get all prime numbers up to n using pure python only + itertools.
+
+shunting - A shunting yard algorithm implementation for converting infix to postfix notation.
+Useful for mathematical or logical expressions. Handles parentheses. Not well documented.
+
+vector - A hopefully easy to use vector class for computations with vectors.
+I made it a long time ago and would probably change few things in there...
View
@@ -36,6 +36,7 @@ def shunting_yard(expr, operators, left_par = '(', right_par = ')'):
return list(output)
-opers = ['or', 'and']
-expr = ['(', 0, 'or', 1, ')', 'and', 2]
-print shunting_yard(expr, opers)
+if __name__ == '__main__':
+ opers = ['or', 'and']
+ expr = ['(', 0, 'or', 1, ')', 'and', 2]
+ print shunting_yard(expr, opers)

0 comments on commit 8bd1c6c

Please sign in to comment.