Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <string>
using namespace std;
struct hero
{
string name;
string job;
int str;
#include <iostream>
#include <string>
using namespace std;
string mapName[3] = {"Volcano", "Forest", "Desert"};
string mapDesc[3] = {"It is a beautiful volcano.\n There is a dark cloud hanging over it.\n It's pretty warm here.", "It's a forest.\n A bunch of critters wander around in it.", "It's a hot, hot desert.\n Not much else to it."};
int main ()
{
@KoaxialKable
KoaxialKable / rot13.cpp
Last active December 23, 2015 00:39
ROT13 assignment
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
const char* INPUTFILE = "secretMessage.txt";
// handles the encoding/decoding of a given char
@KoaxialKable
KoaxialKable / random.cpp
Last active December 23, 2015 05:19
Playing with the new random number generation method
#include <iostream>
#include <random>
const int DIE_SIZE = 8;
const int NUM_ROLLS = 14000;
using namespace std;
int main () {
random_device rd;
@KoaxialKable
KoaxialKable / Cardz.cpp
Last active December 23, 2015 06:59
Basic card shuffler featuring the random library (v2.20)
#include <iostream>
#include <random>
#include <algorithm>
#include <vector>
using namespace std;
enum suits {SPADES, DIAMONDS, CLUBS, HEARTS};
enum modes {ACES_LOW, ACES_HIGH};
@KoaxialKable
KoaxialKable / demo.cpp
Last active December 23, 2015 11:19
Attempt to generate exactly some random rooms.
#include <iostream>
#include <random>
#include <vector>
const int GRID_SIZE = 6;
using namespace std;
struct node
{
@KoaxialKable
KoaxialKable / nodez.cpp
Created September 20, 2013 20:30
Generate onto a field of dots a number of randomly sized and located "rooms" joined by hallways.
#include <iostream>
#include <random>
#include <vector>
#include <cmath>
const int GRID_SIZE = 24;
const int NUM_ROOMS = 6;
const int MAX_ROOM_SIZE = GRID_SIZE / 5 + 2;
using namespace std;
//I could use this (how my teacher chose to do it)
cout << " ";
if (myTurn) cout << "***"; else cout << " ";
cout << " ";
if (!myTurn( cout << "***"; else cout << " ";
cout << endl;
#include <iostream>
#include <iomanip>
const int devilScore = 19;
const int playerScore = 32;
const int streakTotal = 17;
const int dieRoll = 5;
using namespace std;
int main ()
def isPalindrome(n):
if (str(n) == str(n)[::-1]):
return True
return False