This file contains hidden or 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
alphabet = "abcdefghijklmnopqrstuvwxzy" | |
masterSet = dict() | |
def charToIndex(character): | |
return ord(character) - 96 | |
def generateSet(): | |
global masterSet | |
masterSet.clear() | |
basis = list(alphabet) |
This file contains hidden or 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
# Globals, hope there isn't something already in the global space with these names... | |
grid = list() | |
gridSize = 0 | |
masterPermutationList = list(list()) | |
coordinatePermutations = {(1,0), (0,1), (-1,0), (0,-1)} | |
# -100 (probably) indicates a bad x or y index | |
def getValueAt(x, y): | |
if x >= gridSize or y >= gridSize: |
This file contains hidden or 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
#pragma once | |
class BoolArray | |
{ | |
public: | |
BoolArray(); // Default | |
BoolArray(const BoolArray& copy); // Copy constructor | |
BoolArray(BoolArray&& move); // Move constructor | |
This file contains hidden or 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
markBeginGroup = "([{" | |
markEndGroup = ")]}" | |
def decodeInput(inputString): | |
output = "" | |
for character in inputString: | |
if character in markEndGroup: | |
output += " " + (inputString[inputString.rindex(markBeginGroup[markEndGroup.index(character)]) + 1 : inputString.index(character)]) | |
inputString = inputString[ : inputString.rindex(markBeginGroup[markEndGroup.index(character)])] + inputString[inputString.index(character) + 1:] | |
return " ".join(output.split()) |
This file contains hidden or 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 os | |
import re | |
import sys | |
# Keep track of all of the variables by just slapping them in a dictionary | |
filePattern = "[\w]+\.[\w]+" | |
fileRegex = re.compile(filePattern) | |
LIST_DIRECTORY = "Lists" | |
MANDATORY_LISTS = ["Article", "Be", "Character", "FirstPerson", "FirstPersonPossessive", "FirstPersonReflexive", | |
"NegativeAdjective", "NegativeComparative", "NegativeNoun", "Nothing", "PositiveAdjective", "PositiveNoun", |
This file contains hidden or 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
#if defined WIN32 || defined _WIN32 | |
#define _CRT_SECURE_NO_WARNINGS | |
#endif | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> |
This file contains hidden or 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
// sub, mul, and div using only the "+" operator... | |
int negate(int a) | |
{ | |
int i = a < 0 ? 1 : -1; | |
int ret = 0; | |
for(; a != 0; a += i) | |
ret += i; | |
return ret; |
This file contains hidden or 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 os, sys, shutil, re | |
from id3reader import * | |
dirToExportTo = "" | |
def fixSlashes(directory): | |
directory = directory.replace("\\", "\\\\") | |
directory = directory.replace("\\\\", "/") | |
return directory.replace("\\", "/") | |
This file contains hidden or 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
std::string temp = "bbbbcdfagg"; | |
std::sort(temp.begin(), temp.end()); | |
int count = 1; | |
char last = *temp.cbegin(); | |
std::map<int, std::string> tempMap; | |
for (auto&& itr = temp.cbegin()+1; itr != temp.cend(); ++itr) | |
{ | |
if (*itr == last) | |
{ | |
++count; |
This file contains hidden or 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
std::string temp = "bbbbcdfagg"; | |
std::sort(temp.begin(), temp.end()); | |
int count = 1; | |
char last = *temp.cbegin(); | |
std::map<int, std::string> tempMap; | |
for (auto&& itr = temp.cbegin()+1; itr != temp.cend(); ++itr) | |
{ | |
if (*itr == last) | |
{ | |
++count; |