Skip to content

Instantly share code, notes, and snippets.

#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H
class BoardConfig {
public:
unsigned int rows;
unsigned int cols;
unsigned int kLength;
bool gravityFlag;
@Hydrotoast
Hydrotoast / HashTable.cpp
Created November 7, 2012 11:20
Standard Hash Table Implementation
/**
* Gio Borje
* 41894135
*/
#include "HashMap.h"
using namespace std;
/**
* Initializes the node with the specified parameters
@Hydrotoast
Hydrotoast / gist:3995461
Created November 1, 2012 18:09
General Approach for Adversarial Search
int AI::IterativeDeepening(const State& state, int alpha, int beta, int depth) {
if (cutoff(state, depth))
return eval(state);
int result = 0;
for (Move* move : moves) {
State newState = state.clone();
result = max(result, newState.makeMove(state));
}
return result;
}
@Hydrotoast
Hydrotoast / gist:2866520
Created June 4, 2012 05:27
BST Recursive Pseudocode
def insertNode(root, newNode, data):
if root is null:
root = newNode
root.data = data
elif data < root.left:
root.left = insertNode(root.left, newNode, data);
else:
root.right = insertNode(root.right, newNode, data);
return root