Browse code

Removed non-2019 projects; altered README accordingly

haywalk authored on 01/09/2021 14:45:48
Showing 4 changed files

1 1
deleted file mode 100644
... ...
@@ -1,27 +0,0 @@
1
-'''
2
-Recursive binary search algorithm
3
-Hayden Walker
4
-21 July 2020
5
-'''
6
-
7
-def binarySearch(top, bottom, target):
8
-	# Try and look for the target
9
-	try:
10
-		mid = (top + bottom) // 2 # Get midpoint of array
11
-
12
-		if myArray[mid] == target: # If the midpoint is the target, then return it
13
-			return mid
14
-		elif myArray[mid] > target: # If mid > target, set the midpoint as the top limit
15
-			return binarySearch(mid, bottom, target)
16
-		elif myArray[mid] < target: # If mid < target, set the midpoint as the bottom limit
17
-			return binarySearch(top, mid, target)
18
-
19
-	# If the program reaches max recursion depth, the target isn't there
20
-	except:
21
-		return None
22
-
23
-# The array and the target
24
-myArray = [1, 8, 9, 12, 16, 82, 92, 120]
25
-target = 0
26
-
27
-print(binarySearch(len(myArray), 0, target))
28 0
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-'''
2
-Insertion sort algorithm
3
-Hayden Walker
4
-1 August 2020
5
-'''
6
-
7
-def insertionSort(listIn):
8
-	# Starting with the second item in the list, iterate through the list
9
-	for item in range(1, len(listIn)):
10
-		indexToTest = item # Get the index we'll be sorting
11
-		indexToSwap = item - 1 # Get the index we'll be testing the previous one against
12
-		
13
-		# Check all previous indexes for a smaller value than the one we're sorting
14
-		while indexToSwap >= 0:
15
-			if listIn[indexToTest] < listIn[indexToSwap]:
16
-				# If a smaller value is found, swap them
17
-				listIn[indexToTest], listIn[indexToSwap] = listIn[indexToSwap], listIn[indexToTest] 
18
-				# Set the test index to the one we swapped with
19
-				indexToTest = indexToSwap
20
-			# Move back an index
21
-			indexToSwap -= 1
22
-
23
-	# Return the sorted list
24
-	return listIn
25
-
26
-toSort = [13, 16, 9, 22, 29, 3]
27
-
28
-print(insertionSort(toSort))
... ...
@@ -1,6 +1,6 @@
1 1
 # Hayden's Python Portfolio
2 2
 
3
-This is a portfolio of some of my favourite programs I've written in Python since the summer of 2019.
3
+This is a portfolio of some of my favourite programs I wrote in Python during the summer of 2019, the summer I learned to program.
4 4
 
5 5
 **Note: Collatz Conjecture requires the MatPlotLib library, and Conway's Game of Life and the aquarium require PyGame.**
6 6
 
... ...
@@ -19,14 +19,6 @@ A simple aquarium. A random number of fish are spawned, each being an instance o
19 19
   - Multiple instances of a class
20 20
   - Each instance is unique and randomized
21 21
 
22
-## Binary Search Algorithm (21 July 2020)
23
-
24
-A binary search algorithm. A sorted array of numbers is given along with a number to search for. The function will return the position of the target number in the array, or None if it isn't there. Uses recursion.
25
-
26
-- Recursion
27
-- Conditionals
28
-- Exception handling
29
-
30 22
 ## Binary to Decimal Converter (18 August 2019)
31 23
 
32 24
 A simple binary to decimal converter; will accept an arbitrtary amount of bytes of arbitrary lengths.
... ...
@@ -112,15 +104,6 @@ A game of hangman that pulls words from a 100-word text file.
112 104
 - Iterables
113 105
 - Functions
114 106
 
115
-## Insertion Sort (1 August 2020)
116
-
117
-Basic insertion sort algorithm
118
-
119
-- Iteration
120
-- Lists
121
-- For loops
122
-- Algorithms
123
-
124 107
 ## Minefield/Minesweeper (20 July 2019)
125 108
 
126 109
 A game that draws a 5x5 grid, in which a random number of randomly placed mines are hidden. The goal is to clear the board without hitting a mine.
... ...
@@ -151,17 +134,6 @@ The user chooses a number between 0 and 100 (unknown to the computer), and the c
151 134
   - Floor division
152 135
   - Addition
153 136
 
154
-## Roman Numerals to Integer (19 January 2020)
155
-
156
-The user inputs a number in Roman numerals and it is returned as an integer.
157
-
158
-- Dictionary data type
159
-- Conditional
160
-- For loop
161
-  - Continue
162
-- Lists/using indexes
163
-- Iteration
164
-
165 137
 ## Monty Python's Python Soundboard (31 July 2019)
166 138
 
167 139
 A just-for-fun soundboard of clips from Monty Python's Life of Brian. Fun Fact: The Python Programming Language is named after Monty Python!
168 140
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-'''
2
-Roman numeral to integer converter
3
-Hayden Walker, 19 January 2020
4
-'''
5
-romanNum = input().upper()
6
-parts = list()
7
-num = 0
8
-
9
-romanLets = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000 }
10
-
11
-for let in romanNum:
12
-	'''
13
-	Replace the letters with the values they represent
14
-	'''
15
-	parts.append(romanLets[let])
16
-
17
-for part in parts:
18
-	ind = parts.index(part)
19
-	
20
-	# If not at the end && number is less than next index: subtract it
21
-	if (ind != len(parts) - 1) and (part < parts[ind + 1]):
22
-		num -= part
23
-		continue
24
-
25
-	# Otherwise add the number
26
-	num += part
27
-
28
-print(num)