Skip to content

Instantly share code, notes, and snippets.

View wallstop's full-sized avatar
🎯
Focusing

Eli Pinkerton wallstop

🎯
Focusing
View GitHub Profile
alphabet = "abcdefghijklmnopqrstuvwxzy"
masterSet = dict()
def charToIndex(character):
return ord(character) - 96
def generateSet():
global masterSet
masterSet.clear()
basis = list(alphabet)
# 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:
#pragma once
class BoolArray
{
public:
BoolArray(); // Default
BoolArray(const BoolArray& copy); // Copy constructor
BoolArray(BoolArray&& move); // Move constructor
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())
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",
@wallstop
wallstop / main.c
Last active August 29, 2015 13:57
#if defined WIN32 || defined _WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
// 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;
import os, sys, shutil, re
from id3reader import *
dirToExportTo = ""
def fixSlashes(directory):
directory = directory.replace("\\", "\\\\")
directory = directory.replace("\\\\", "/")
return directory.replace("\\", "/")
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;
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;