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
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]; |
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 <cmath> | |
#define PI 3.1415926535897932384626433832795 | |
using namespace std; | |
int main() | |
{ | |
double x = 0; | |
double y = 2; | |
double r = sqrt(x*x + y*y); |
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 "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); | |
} |
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
public class HelloWorld | |
{ | |
public static void main(String [] args) | |
{ | |
System.out.println("Hello World!"); | |
} | |
} |
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
public class Person | |
{ | |
//Add the details to our person! | |
Person(int inAge, String inName, String inGender) | |
{ | |
age = inAge; | |
name = inName; | |
gender = inGender; | |
} |
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.h> | |
using namespace std; | |
class Person | |
{ | |
public: | |
Person(int inAge, string inName, string inGender) | |
{ |
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 <SFML/Graphics.hpp> | |
#include <random> | |
#include <time.h> | |
#include <sstream> | |
#include <vector> | |
#include <unordered_set> | |
enum class Suit |
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 <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) |
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 <random> | |
#include <stack> | |
#include <vector> | |
#include <unordered_set> | |
#include <string> | |
#include <iterator> | |
#include "../headers/card.h" | |
using std::vector; |
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 <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) |
OlderNewer