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
#This is from Dalhousie Univerisity's programming competition, problem letter D. | |
#It was the easist. There were 7 lines of input. I was suposed to print the average of the highest 6 values, | |
#with the output formatted to four decimal places. | |
#Due to its brevity, I haven't code commented it. | |
a = [] | |
for each in range(7): |
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
#This was Dalhousie Programming Competition 2014 programming problem letter B. | |
#I found that the 2d lists (Python doesn't have 2d arrays; they have things called lists, similar to arrays, but only one dimensional... | |
#you had to have lists in lists to have dimensionality) I've used while programming an older Sudoku program of mine to be helpful | |
#This Problem had a varying ammount of inputs. The first input was how many inputs was going to follow, | |
#While all lines after that were in the format "name ##". The ## was a number between 1 and 100, an represents | |
#The mark of each name. The names were useless, but I was suposed to make a histogram based on how many people | |
#Got Something in the tens digit. In other words... |
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
#This was Dalhousie University's 2014 programming competition problem letter E. | |
#We were suposed to have input as a text file, which were suposed to be mock examples of twitter posts. We had to output any | |
#line that contained a line that contained an expression like "3-4". | |
#This was meant to be done with Regular Expressions, but I have had no knowledge in those, so I had to do something unique and creative. | |
#I also did something I have never done before in programming - error trapping. Although very basic one and probably not the | |
#intended use for them, I have used them to solve my problem, with only having read what the try and except keywords did. | |
#My solution to go through every letter of every line, put each letter to a new string if it wasn't a number, and if it was a number, |
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
#This was problem A of the Dalhousie programming competiton. Of the four of five submissions I made, this was the only one that | |
#didn't suceed, and is also the most messiest and hardest to follow, but felt this showed some creative thinking | |
#The problem was that I had to figure out who won, based on how many problems the person solved, and if there's a tie, who did it in the shortest | |
#combined time of the problems. | |
#I would of had one line of input Which would be four numbers, representing the number of people in the competition, | |
#The number of problems there's going to be, what hour the competition started, and what minute the competition started. | |
#The second line is how many attempts to a problem there was from each person total |
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 random | |
#Before the Saint Mary's competition, I've written two classes to use for creating a Rubix cube, to practice | |
#Objects in object-oriented languages. | |
#This was the basis of which I derived my Visual Basic Rubix Classes Module. | |
class Face: | |
def __init__(self, colour): | |
self.colour = colour |
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
'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 | |
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
'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 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 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 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; |
OlderNewer