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 <iostream> | |
#include <string> | |
using namespace std; | |
char board [9]; | |
void display_board (void); | |
bool validate (int z); | |
int winner (); //returns a 0 for draw, 1 for player 1, and 2 for player 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
#include <iostream> | |
#include <string> | |
#include <cctype> | |
using namespace std; | |
char board [9]; | |
void display_board (void); | |
bool validate (int z); |
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
/* cracklePop prints out numbers 1 - 100 while substituting "Crackle" and "Pop" | |
for numbers divisible by 3 and 5, respectively */ | |
var cracklePop = function () { | |
/*print out the numbers 1 to 100 (inclusive). */ | |
for (var i = 1; i <= 100; i++){ | |
/* If the number is divisible by 3 and 5, print CracklePop */ | |
if ( (i % 3 === 0) && (i % 5 === 0) ) { | |
console.log("CracklePop"); | |
} | |
/* If the number is divisible by 3, print Crackle */ |
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
# Recurse Center Application 2016, Emily Boynton | |
# Code below includes a class Tree which can create a navigable tree | |
# and a function dfs() or "Depth-first Search" which allows a user to | |
# search the entire tree for a specific tree (by its name) | |
# class Tree gives each "node" a name, array of children, and parent. | |
# Tree navigation includes: parent(), find_child(), to_root(), add() | |
# Tree functions include: print_children(), print_whole_tree(), print_tree() | |
class Tree: |