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 java.io.BufferedReader; | |
import java.io.FileReader; | |
public class CodeGolfParser | |
{ | |
public static void parse(String fileName) throws Exception | |
{ | |
BufferedReader fReader; | |
int characterCount; |
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
# Finds the all potential sums for some 3-space configuration of x y z dimensions | |
# with values corresponding to inputArray, stacked in precedence of x, y, z | |
def sumFinder(x, y, z, inputArray): | |
foundZeroSum = False | |
# Checks all potential sets starting with a single value | |
for i in range(0, len(inputArray)): | |
xSum = list() | |
ySum = 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
import math | |
def raycast(grid, x, y, radian): | |
radian += math.pi | |
unitVector = [math.cos(radian), math.sin(radian)] | |
found = False | |
while not found: | |
x += unitVector[0] |
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
template<typename T> | |
LinkedList<T>::LinkedList() | |
{ | |
head = new node; | |
tail = new node; | |
head->prev = 0; //This can also be null, same thing. | |
head->next = tail; | |
tail->next = 0; |
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
public class main | |
{ | |
public static void main(String [] args) | |
{ | |
fib(10); | |
} | |
// These can be inside the function, but it saves computation time not to redefine them everytime | |
static final double alpha = (1 + Math.sqrt(5)) / 2; | |
static final double omega = (1 - Math.sqrt(5)) / 2; |
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 java.util.HashSet; | |
public class main | |
{ | |
public static void main(String [] args) | |
{ | |
fib(10); | |
} | |
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
package edu.smcm.ButterSealGame; | |
import android.content.Context; | |
import android.util.DisplayMetrics; | |
import android.view.Display; | |
import android.view.WindowManager; | |
import com.badlogic.gdx.ApplicationListener; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.audio.Music; |
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
#include <ConcurrentDX/ConcurrentDX.h> | |
#include <thread> | |
#include <atomic> | |
#include <iostream> | |
#include <vector> | |
using namespace DX; |
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 math | |
def fibonacci(index): | |
if(index < 1): | |
return -1 | |
return int(1/math.sqrt(5) * math.pow(((1 + math.sqrt(5)) / 2), index) - 1/math.sqrt(5) * math.pow(((1 - math.sqrt(5)) / 2), index)) |
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
alphabet = "abcdefghijklmnopqrstuvwxzy" | |
masterSet = list() | |
def generateSet(): | |
global masterSet | |
masterSet.clear() | |
basis = list(alphabet) | |
masterSet = list(alphabet) | |
for i in range(0, 26): | |
newList = list() |
OlderNewer