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
// Mark J. Rigdon | |
// CS50 2019 | |
// pset 3 | |
// Copies and alters a BMP file | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "bmp.h" |
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
// Mark J. Rigdon | |
// CS50 | |
// pset3 - resize (less) | |
// 2019-01-25 | |
// resizes a 24-bit uncompressed BMP by a factor of n using a "recopy" method. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "bmp.h" |
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
// Mark J. Rigdon | |
// CS50 | |
// 2019-01-30 | |
// pset3 recover.c | |
// Inputs a raw data file, finds the JPEG's in the file, writes the JPEG's out to individual files. | |
/****** Mark's Pseudocode Outline ****** | |
x Ensure proper syntax of command is input by user | |
x Ensure recover command fails over nicely if the file input cannot be accessed/read | |
x open memory card file |
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
def reverse_string(string) | |
split_string = string.split("") | |
reversed = [] | |
string.size.times { reversed << split_string.pop } | |
reversed.join | |
end | |
puts reverse_string("codelabslone") |
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
// Mark J Rigdon | |
// 2018-12-11 | |
// Problem set 1 | |
// Program calculates the minimum number of coins required to give a user change. | |
// Greedy algorithm example... | |
#include <cs50.h> | |
#include <math.h> | |
#include <stdio.h> |
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
// Mark J Rigdon | |
// 2018-12-11 | |
// Problem set 1 | |
// Creates a half right-aligned pyramid and a left-aligned pyramid for Mario | |
#include <cs50.h> | |
#include <stdio.h> | |
int main(void) | |
{ |
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
// Mark J Rigdon | |
// 2018-12-11 | |
// Problem set 1 | |
// Creates a half right-aligned pyramid for Mario | |
#include <cs50.h> | |
#include <stdio.h> | |
int main(void) | |
{ |
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
// caesar.c by Mark J. Rigdon | |
// CS50 | |
// 2018-12-16 | |
// Program encrypts messages using Caesar's cipher. | |
// Includes | |
#include <cs50.h> | |
#include <ctype.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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
// vigenere.c by Mark J. Rigdon | |
// CS50 | |
// 2018-12-16 | |
// Program encrypts messages using Vigenere's cipher. | |
// Includes | |
#include <cs50.h> | |
#include <ctype.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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
array.each_with_object({odd:[], even:[]}) do |elem, memo| | |
memo[elem.odd? ? :odd : :even] << elem | |
end |
NewerOlder