This file contains hidden or 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 <cstdlib> | |
struct dynamicNode { | |
void* data; | |
int type; | |
dynamicNode* next; | |
}; | |
// I've uploaded this so I may self-reference it later |
This file contains hidden or 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
# ==== Basics ===== | |
#This is how you comment in Ruby! Think # is like a // | |
puts "Hello, World!" | |
#Equivalent to System.out.println("Hello, World!"); | |
print "Type something in: " | |
#Equivalent to System.out.print("Type something in: ")\ |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
int *p = (int*)malloc(sizeof(int)*2); | |
*p = 4; | |
++p; | |
*p = 2; | |
printf("%d", p[-1]); /* Prints 4 */ | |
return 0; | |
} |
This file contains hidden or 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; | |
// Note: I was a bit tired wrapping this up, so I could use a bit more code comments | |
// And I didn't clean up a few things to have "proper coding style", normally mixing | |
// variables beginning with capitals and what not | |
// Note2 (Wrotten after it was uploaded): it looks like I was dynamically adding nodes to the | |
// linked list wrong, they should be added at the head, not the tail. | |
// Also, I'll work on being consistent on my code style in next ones, I'll just leave things here |
This file contains hidden or 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; | |
int main(int argc, char* argv[]) { | |
// Node struct | |
struct Node { | |
int data; | |
Node *next; | |
}; |
This file contains hidden or 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; | |
int main() | |
{ | |
// Node Structure | |
struct Node { | |
int data; | |
Node *next; |
This file contains hidden or 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; | |
void function(string var, int flag); | |
int main(){ | |
function(R"!( | |
#include <iostream> |
This file contains hidden or 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 <stack> | |
#include <string> | |
#include <iostream> | |
#include "RomanConversionTools.hpp" | |
using namespace std; | |
int main (int argv, char* argc[]) { | |
// Examine arg count and exit if there's an incorrect parameter ammount | |
if (argv != 2) { | |
cout << "Wrong ammount of parameters" << endl; |
This file contains hidden or 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
'This sub procedure (which is linked to a wpf button in Visual Studio) solves a rubix cube by using | |
'Algorithms that prodecurally solve it. | |
'I put a lot of hours in it; taking most of my week evenings to code it, and taking time during class to write down pseudocode. | |
'However, I still manage to complete the entire code in just a week. However, despite it working as supsected (once | |
'I've got the final revision on it, I have not had it lock up once on proper cubes), there's still many things | |
'about the code that could be improved. I feel most of it's unfineness was a result in a pressure to finish it. However, some | |
'of the problems include: | |
'-The entire thing is nested in one big while statement. Although I originally had intentions for having it in |
This file contains hidden or 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
'The two classes here were used in "The Interactive Rubix Cube", created by Evan Larose and Tristan Murphy, | |
'for the SMU 2014 hackathon | |
'All code comments below were included in the actual module | |
Module RubixClasses | |
'The sides represent each face of the Rubix Cube. They're used in the cube class before. | |
'They have a string variable to represent what colour they are, as well as | |
'a 3x3 array of string that represent each square on the side | |