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 "game.hpp" | |
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
void output(player player1, player player2); | |
int main(){ |
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
/* | |
fsm.cpp - Finite State Machine | |
Read the header file 'fsm.hpp' for all documentation on individual | |
functions. I suggest you start by getting the unit test cases to | |
pass in order. E.g. start with the Defaults one, then do Add States, | |
and so on. | |
Your Name: Luke Woodruff |
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
void bubblesort(vector<int> &data) { | |
bool swap = true; | |
int temp; | |
int size = data.size(); | |
while(swap == true){ | |
for(int i=0; i < size; i++){ | |
if(data[i] < data[i-1]){ | |
temp = data[i]; | |
data[i] = data[i+1]; |
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 "binary_search_tree.h" | |
bt_node* init_node(int data) { | |
// implement me | |
bt_node* new_node; | |
new_node->data = data; | |
new_node->left = NULL; | |
new_node->right = NULL; | |
return new_node; | |
} |
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
void remove_recursively(bt_node* top, int data){ | |
if(top->data == data){ | |
if(top->right == NULL && top->left == NULL){ | |
top->data = NULL; | |
}else{ | |
if(top->data < data){ | |
remove_recursively(top->left, data); | |
}else{ | |
remove_recursively(top->right, data); | |
} |