Code written for the TJHSST Artificial Intelligence class, here for archival purposes.
Divided by the quarter of the school year in which it was written.
- implementation of 3-element vectors in vector.py
- DFS and BFS graph navigation in routes.py
- 2D graphics done with tkinter
- A* / A Star pathfinding in astar.py
- Nelder-Mead downhill simplex method in labnmead.py
- Converting repeating decimals to fractions in recurringdecimal.py
- AI that plays Ghost in ghost.py
- AI that plays Othello / Reversi in revised_othello1.py. (Older versions also present.) Uses methods such as
- N-ply minimax decision making
- Alpha-beta pruning
- Solving Sudokus in sudokusolver.py
- Fast word lookups with a trie in trie.py
- Generating from Wolfram's Elementary Cellular Automata Rules in cellular.py
- In machinevision.py:
- Detecting lines with Hough Transform in houghtransform.py
- Monte-Carlo experiment on unique birthdays in uniquebirthdays.py
- Hillclimbing to solve the N-Queens problem in nqueens.py
- Self-teaching / dynamically learning Tic-Tac-Toe AI in tictak.py
- Simple neural networks of various sorts, touching on
- Feed forward in ann4.py, feedfowrard.py
- Back propagation in ann5.py
- Setup for some simple genetic algorithm generation simulation in genetic2.py
One unit was focused around permutations; these files have been split off in a separate folder.
- Basic permutations in nthPermBasic.py
- Navigating lexicographic permuatations (given the nth, calculate the n+1th) in perms.py and nextPermLexi.py
- Alphametics puzzle solver using permutations in solver.py