Skip to content

I will upload every piece of code that is cool to me. These cool codes may include a Coursera course side project or can be a simple zero-player game that is played in Terminal!!!

Notifications You must be signed in to change notification settings

behzadshomali/Cool-random-stuff

Repository files navigation

Cool Random Stuff!

This repository contains every random piece of code that I have found Cool! Moreover, it is the result of merging two of my public repositories known as Cool and Algorithms. Here, you'll find everything from simple multiline scripts to some well-known algorithms such as Shunting yard or Huffman compression algorithms (mostly from my junior and sophomore years at university). Below, you can find the alphabetically ordered list of this repo's contents as well as a brief description for each:

  • Arxiv PDF renamer: If you've worked with arxiv.org, you'll probably know how painful it is when you download a paper from arxiv and then have to rename it to something meaningful. However, you can use this script to automatically rename the PDF files downloaded from arxiv to the following format: title.pdf.

  • Backup: a small Python script that allows you temporarily back up the existing files under the current directory to /tmp/ on your UNIX machine.

  • Game of life: a Python implementation of Conway's Game of Life (read more here)

  • Huffman: a Python implementation of Huffman compression algorithm (read more here) which was done for the "Design of Algorithms" course

Image source: wikipedia.org

  • K-means compression: here you can choose the intended number of colors appearing in your image (K). Afterward, by performing a K-means clustering, K colors (the cluster centroids) are chosen and then all the colors are transformed to those.

  • Kakuro solver: a simple Kakuro solver implemented in Python (read more about Kakuro, here). It uses a backtracking algorithm to solve the given puzzle. This code was developed as a part of the "Introduction to AI" course projects.

Image source: researchgate.net

  • Number of lines: by running this small Python script, you'll get different file formats (like .txt, .cpp, .py, and so on) as well as the accumulated number of lines of files existing in the intended address.

  • Parentheses checking: using the stack data structure, this C++ program simply checks if in an arithmetic expression the parentheses match.

  • Path finding: with the help of Python and Pygame, the two most well-known search algorithms, A* and BFS are visualized. Users are also able to a little bit customize the map.
A* search BFS search No way :/
  • Shunting Yard algorithm: a C++ implementation of the Shunting Yard algorithm which is used for parsing mathematical expressions specified in infix notation.

Image source: wikipedia.org

  • Sudoku solver: a Sudoku solver implemented in Python. It uses a backtracking algorithm to solve the given table (the empty cells are specified with 0).

About

I will upload every piece of code that is cool to me. These cool codes may include a Coursera course side project or can be a simple zero-player game that is played in Terminal!!!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published