forked from karan/Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Current Project: None Latest Project: Text/CryptoCiphers.py --Implemented Algorithms/bogosort.py because it was silly --Implemented Algorithms/radixsort.py for fun --Modified the general commenting of the files.
- Loading branch information
Showing
10 changed files
with
117 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from sys import argv | ||
import argparse | ||
import random | ||
array = argv[1] | ||
array = array.split(",") | ||
array = [int(l) for l in array] | ||
|
||
def isSorted(array = []): | ||
n = 1 | ||
while( n < len(array)-1 ): | ||
if( array[n] < array[n-1] ): | ||
return False | ||
n = n + 1 | ||
return True | ||
|
||
def shuffle(array = []): | ||
temp = 0 | ||
rand = 0 | ||
for i in range( len(array) ): | ||
temp = array[i] | ||
rand = int( random.random() * ( len(array)-1 ) ) | ||
array[i] = array[rand] | ||
array[rand] = temp | ||
return array | ||
|
||
def bogosort(array = []): | ||
while(not isSorted(array)): | ||
array = shuffle(array) | ||
print("Shuffle!" + str(array) ) | ||
return array | ||
|
||
print("Acquired array: " + str(array) ) | ||
print("Bogo sort activate!") | ||
array = bogosort(array) | ||
print("Bogo sort complete!") | ||
print(array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from sys import argv | ||
import argparse | ||
from collections import deque | ||
import math | ||
array = argv[1] | ||
#base = int(argv[2]) | ||
array = array.split(",") | ||
array = [int(l) for l in array] | ||
|
||
def radixsort(array, base = 10): | ||
# Check if the array is sorted | ||
# Create 10 queues, one for each digit. | ||
queueList = [] | ||
for i in range(10): | ||
queueList.append(deque()) | ||
|
||
# Find the largest number in the list. | ||
highestNumber = max( abs(num) for num in array ) | ||
#Acquire the total number of passes in the algorithm (1 for each digit) | ||
totalPasses = int(math.log(highestNumber, base) + 1) | ||
for digitNum in range(totalPasses): | ||
#print(digitNum) | ||
print(array) | ||
for num in array: | ||
index = str(num).zfill(digitNum + 1) | ||
index = index[::-1] | ||
#print("Value: " + str(index) + " Digit: " + str(digitNum) + " index[digit]:" + str(index[digitNum]) ) | ||
#print(digitNum) | ||
#print(index[digitNum]) | ||
queueList[int(index[digitNum])].appendleft(num) | ||
#print(str(queueList)) | ||
array = [] | ||
for q in queueList: | ||
while(len(q) > 0): | ||
array.append(q.pop()) | ||
|
||
# Return the sorted array | ||
return array | ||
print("Acquired array: " + str(array)) | ||
print("Radix sort activate!") | ||
array = radixsort(array) | ||
print("Radix sort complete!") | ||
print(array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Make a screensaver program that will run while your computer sits idle. | ||
#To make a simple one use some standard pictures and then for added complexity try a 3D object that spins around the screen and bounces off the sides. | ||
# To make a simple one use some standard pictures and then for added complexity | ||
# try a 3D object that spins around the screen and bounces off the sides. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Ever seen those web board posts where someone has a generated signature made up? See if you can make a program that allows the user to specify a background, text, colors and alignment to make their own signatures or userbars. | ||
# Ever seen those web board posts where someone has a generated signature made up? | ||
# See if you can make a program that allows the user to specify a background, text, | ||
# colors and alignment to make their own signatures or userbars. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
# An application that attempts to connect to a website or server every so many minutes or a given time and check if it is up. | ||
#If it is down, it will notify you by email or by posting a notice on screen. | ||
# If it is down, it will notify you by email or by posting a notice on screen. | ||
|
||
import sys | ||
|
||
|
||
if __name__ == '__main__': | ||
while(True): | ||
print("Checking site") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# An automated program which carries out tasks on the web including checking websites, page scraping, and summarization of data or web posting. | ||
# An automated program which carries out tasks on the web including checking | ||
# websites, page scraping, and summarization of data or web posting. |