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 Control.Monad | |
import Data.Char | |
import Data.Maybe | |
import Data.Map.Strict (Map) | |
import qualified Data.Map.Strict as Map | |
data State = State { code :: [Char], codeIndex :: Int | |
, memory :: [Int], memIndex :: Int | |
, input :: [Char], brackets :: Map Int Int } |
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
main = do | |
print $ map writeNumber [1..100] | |
writeNumber :: Int -> String | |
writeNumber n | |
| n == 0 = "" | |
| n == 1 = "one" | |
| n == 2 = "two" |
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> | |
using namespace std; | |
class Node { | |
private: | |
bool hasValue_; | |
int value_; | |
Node *left_; | |
Node *right_; |
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 <map> | |
#include <vector> | |
#include <string> | |
#include <fstream> | |
#include <sstream> | |
#include <streambuf> | |
using namespace std; | |
// TODO: Make dataIx a char* |
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 <vector> | |
using namespace std; | |
class Student { | |
public: | |
string fName_, sName_; | |
int id_, grade_; |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <cmath> | |
using namespace std; | |
bool sortfunc(pair<int, int> p1, pair<int, int> p2){ | |
return pow(p1.first, 2) + pow(p1.second, 2) < | |
pow(p2.first, 2) + pow(p2.second, 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 <clocale> | |
#include <cmath> | |
#include <ncurses.h> | |
#include <unistd.h> | |
#include <vector> | |
#include <ctime> | |
#include <cstdlib> | |
using namespace std; |
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
// As simple of a starting point as I can make for a console game! | |
// Aka a very stripped down version of my own project. | |
// Reads console input as arrow keys and wasd, | |
// and allows you to move a player around the screen. | |
// To build, save as starting_point.cpp, then build with | |
// g++ starting_point.cpp -o starting_point -lncurses |
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
$(document).keydown(function(e) { | |
switch(e.which) { | |
case 'h': // left | |
createjs.Sound.play((wordNumber = (wordNumber %5) + 1) + "_1", createjs.Sound.INTERRUPT_NONE, 0, 0, false, 1); | |
break; | |
case 'j': // up | |
createjs.Sound.play((wordNumber = (wordNumber %5) + 1) + "_2", createjs.Sound.INTERRUPT_NONE, 0, 0, false, 1); | |
break; |
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
// Program to convert to roman numerals. | |
// | |
// I'm going to split the number into digits, and call a function to | |
// convert each one to roman numerals individually. | |
#include <string> | |
#include <iostream> | |
using namespace std; |
OlderNewer