Skip to content

Instantly share code, notes, and snippets.

View samanthadoran's full-sized avatar

Samantha Doran samanthadoran

  • Seattle, Wa
  • 13:23 (UTC -07:00)
View GitHub Profile
public void add(int value) {
if (numElements == list.length) {
System.out.println("Can't add, list is full");
} else {
for (int i = 0; (i <= numElements); ++i) {
// The value is smaller than all things on the list or is the
// same as the smalles
if ((i == 0 && value <= list[0])) {
for (int j = numElements; j > 0; --j) {
list[j] = list[j - 1];
#include <iostream>
#include <cmath>
#define PI 3.1415926535897932384626433832795
using namespace std;
int main()
{
double x = 0;
double y = 2;
double r = sqrt(x*x + y*y);
#include "include/object.h"
#include <math.h>
#include <iostream>
#include <sstream>
#define epsilon 0.000000000001
#define t .1
bool fIsEqual(float x, float y)
{
return (abs(x-y)<epsilon);
}
public class HelloWorld
{
public static void main(String [] args)
{
System.out.println("Hello World!");
}
}
public class Person
{
//Add the details to our person!
Person(int inAge, String inName, String inGender)
{
age = inAge;
name = inName;
gender = inGender;
}
#include <iostream>
#include <string.h>
using namespace std;
class Person
{
public:
Person(int inAge, string inName, string inGender)
{
@samanthadoran
samanthadoran / gist:6789012
Last active December 24, 2015 11:09
I'm... not really sure why I wrote this, or wrote it so poorly
#include <iostream>
#include <string>
#include <SFML/Graphics.hpp>
#include <random>
#include <time.h>
#include <sstream>
#include <vector>
#include <unordered_set>
enum class Suit
#include <iostream>
#include <SFML/Graphics.hpp>
#include <random>
#include <time.h>
#include <vector>
#include <unordered_set>
#include <chrono>
#include "../headers/card.h"
//An optimized function to generate cards, O(n)
@samanthadoran
samanthadoran / gist:7059396
Last active December 25, 2015 23:49
Text variant of Solitaire (Klondike)
#include <iostream>
#include <random>
#include <stack>
#include <vector>
#include <unordered_set>
#include <string>
#include <iterator>
#include "../headers/card.h"
using std::vector;
//メロさん
#include <iostream>
#include <vector>
#include <math.h>
#include <cstdlib>
using namespace std;
//A "full-adder" of sorts, currently using a while loop rather than multiple circuits
vector<bool> adder(vector<bool>::iterator a, vector<bool>::iterator b)