A compilation of all my programming projects; including code and working examples, from throughout the year.
Trivia Quiz
This program uses variables, conditions and raw input to create an interactive, 10-question text-based quiz.
Mad Libs Nursery Rhyme
Adding a twist to a familiar nursery rhyme, raw input from the user is stored in variables and used to replace certain words through print-statement concatenation.
Virtual Restaurant Menu
A fantastical representation of a restaurant order is created with a while loop and user raw input to record the type of food ordered. When the user decides to end their order, the program stops the while loop and automatically calculates the total price.
Guess the Number
After a random number between 1 and 500 is generated by the program using the randint() function of Python's random library, the user will be given 15 attempts to guess what the number is by typing in raw input. The program will give feedback after each attempt on whether the guess is greater or less than the answer.
Rock-Paper-Scissors
This program is a recreation of the game Rock-Paper-Scissors in Python. Here, the user plays against the program, which selects its moves from a predefined list containing the three moves using random.choice(). The user chooses his/her desired move by typing in raw input, and every possible outcome is covered by a series of if/elif/else condition statements.
Five-Move Rock-Paper-Scissors
This program simply adds two more options to the previous Rock-Paper-Scissors program, for a total of five rather than three different moves. The existing set of condition statements is expanded to cover the new outcomes.
Container Volume Calculator
A calculator program that uses user raw input to calculate the volume of several predetermined 3D solids based on dimensions the user inputs. This program extensively uses the 'def' statement and custom-defined functions to contain actions that are performed repeatedly throughout the program.
Sum My List
A program that automatically calculates the sum of a list of numbers inputted by the user.
Twenty Questions
A "can you guess the answer" game is created through the use of nested condition statements.
Choose Your Adventure
A text-based adventure game, this program is essentially an expansion of the previous 'Twenty Questions' program, utilizing a similar but significantly larger and more complex set of nested condition statements to form several diverging story plots bases on the user's choices.
Honeycomb
Using the 'turtle' graphics library of Python and 'for' loops, this program draws a simple 2D array of seven hexagons in a honeycomb arrangement.
Mandala
Python turtle and 'for' loops are used to draw a highly intricate line drawing of a mandala.
Turtle Spiral
'for' loops, the 'random' library and the turtle.stamp() function are used to create a spiral composed of numerous multicolored turtles.
Octagon Flower
With the addition of the .begin_fill() and .end_fill() functions of the 'turtle' library to fill in a turtle drawing with solid color, turtles are used to draw a ring composed of eight overlapping, multicolored octagons.
Cone
This program creates a line drawing of a cone using Python turtle.
Hexagonal Prism
This program creates a line drawing of a hexagonal prism using Python turtle.
Fading Spiral
'for' loops and variables are used to draw a square with a gradient color effect.
Thanksgiving Art
Using a complex series of turtle functions, this program creates a complex Thanksgiving-themed image.
Turtle Shuffle
Using lists and custom-defined functions, this program calculates the coordinate positions of two turtles from a square array of eight turtles and swaps their positions.
Pixel Function
By utilizing Python turtles to draw equal-sized squares, this program; with the help of a number of custom-defined functions to simplify repetitive actions, draws an elaborate pixel art image.
Intricate Pixel Art
This program greatly simplifies the process of drawing pixel art with turtles, condensing the entire drawing functionality into a single custom-defined function responsible for drawing individual rows. Two lists of values; serving as parameters for each row function, determine the color and location of specific pixels.
Three Bouncing Balls
This program uses Python's processing package to create a continuously running loop. Dictionaries are also utilized to store the values and coordinates of each of the three balls, which are updated after every iteration of the loop to make them move around the canvas and bounce off its edges.
Ball Trace
Derived from the previous 'Three Bouncing Balls' program, the canvas no longer redraws each frame, making the ball now appear to trace its path with past images of itself.
Random Ball Path
This program is similar to the 'Ball Trace' program, except now, the ball's x and y velocity will each reset to random values rather than simply reverse with each bounce, making it have an irregular path.
Racquetball Game
The processing loop introduced in the last few projects is now expanded into a functional game loop, which also introduces a keyboard-controlled paddle and a scoring system to create this simple racquetball game.
Pong
This recreation of the classic Pong video game in Python simply expands the racquetball program to add a second paddle and scoring system, as well as an upper limit of 11 points which determines the winner.
Brick Breaker Game
An even further expansion of the racquetball program, this program introduces stationary bricks that disappear and yield points when hit by the ball. This array of bricks is generated by a loop-based algorithm before the game starts. A limited number of lives is also introduced.
Multi-Level Brick Breaker Game
This program builds on the Brick Breaker program by adding four additional levels that must be beaten before winning the game. The layout of all levels are each generated by an algorithm just before the game starts.
Maze Game
The Python Processing Package's game loop is now utilized to create this tile-based game that involves the player navigating through the maze. The maze layout is predetermined beforehand by a two-dimansional array and certain tiles have varying effects on the player. A timer is also introduced.