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
import sys,time | |
message = "please enter your name: " | |
def typewriter(message): | |
for char in message: | |
sys.stdout.write(char) | |
sys.stdout.flush() | |
if char != "\n": |
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
import random,time,os | |
l = [i for i in range(10)] | |
random.shuffle(l) | |
def redraw(arrow = "↑",shift=0,moved_right=False): | |
os.system('cls') | |
print() | |
print("Outer Index:",index, "\tCurrentValue: ",currentValue, "\tInner Index:",currentPosition) | |
print() |
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
import time,random | |
l = [] | |
for i in range(20): | |
l.append(random.randint(1,1000)) | |
def bubble_sort(l): | |
l = l[:] | |
while True: | |
swapped = False |
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
import csv,os,time,sys,random | |
def get_maze(file): | |
f = open(file,'r') | |
reader = csv.reader(f) | |
maze = [] | |
for line in reader: | |
maze.append(line) | |
return maze |
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
# Adapted from - http://openbookproject.net/thinkcs/python/english3e/recursion.html | |
def get_dirlist(path): | |
""" | |
Return a sorted list of all entries in path. | |
This returns just the names, not the full path to the names. | |
""" | |
try: | |
dirlist = os.listdir(path) | |
dirlist.sort() |
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
chars = "abcdefghijklmNO123£$%" | |
for a in chars: | |
print(a) | |
for b in chars: | |
print(a+b) | |
for c in chars: | |
print(a+b+c) | |
for d in chars: | |
print(a+b+c+d) |
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
chars = "abcABC123£$%" #Add as many chars as you like to the test (or generate using and ord to chr range) | |
maxlen = 4 #Maximum password length to generate. | |
def brute(current): | |
print(current) | |
if len(current) == maxlen: | |
return | |
for letter in chars: |
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
a=[[9, 15, 25],[4, 14, 18, 25],[11, 12,24, 25],[4, 8, 9, 26]] | |
b=[[2, 4, 7, 13, 14],[3, 5, 8, 13, 14],[6, 9, 10, 13, 14],[5, 6, 7, 13, 15],[3, 4, 9, 13, 15],[2, 8, 12, 13, 15],[4, 6, 8, 14, 15],[2, 5, 9, 14, 15]] | |
#Basically i would like to match 2d list to another 2d list. | |
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
<iframe src="https://scratch.mit.edu/projects/PROJECTID/embed" width="800" height="600"></iframe> |
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
<iframe src="https://scratch.mit.edu/projects/PROJECTID/embed" width="800" height="600"></iframe> |
NewerOlder