{{ message }}

Instantly share code, notes, and snippets.

# Craig Rodrigues CraigRodrigues

Created Jul 7, 2016
CS50 pset4 - "Recover"
View recover.c
 /** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a forensic image. */ #include
Last active May 16, 2021
My solution to CS50 pset2 - "Hail, Caesar!"
View caesar.c
 #include #include #include #include /** * Caesar.c * A program that encrypts messages using Caesar’s cipher. Your program must * accept a single command-line argument: a non-negative integer. Let’s call it * k for the sake of discussion. If your program is executed without any
Created Jun 3, 2016
My solution to CS50 Hacker pset1 - "Bad Credit"
View credit.c
 #include #include #include #include #include // calculates the number of digits in the card number int getCardDigits(long long card_num) { int card_digits = (int)log10(card_num) + 1;
Last active Jan 19, 2021
CS50 pset4 - "Resize"
View resize.c
 /** * resize.c * * Computer Science 50 * Problem Set 4 * * Copies a BMP piece by piece, but also resizes it, just because. */ #include
Last active Dec 23, 2020
Toy Problems #1
View toyProblems.js
 /** * Given a single input string, write a function that produces all possible anagrams * of a string and outputs them as an array. At first, don't worry about * repeated strings. What time complexity is your solution? * * Extra credit: Deduplicate your return array without using uniq(). */ /** * example usage:
Created Nov 18, 2016
Converting cm to inches to nearest 1/16th inch
View convert.js
 // The company I work for creates custom acrylic cases based on customer's inputted dimensions. // For fabrication our dimensions go down to the nearest 1/16th inch. // International customers may use cm (or mm) and this is a program that will attempt to convert cm to inches // down to the nearest 16th of an inch and display the result as a reduced fraction. // 1 cm is equivalent to 0.39370 inches. // EXAMPLE: 16.4 cm = 6 7/16 inches // EXAMPLE: 10.5 cm = 4 2/16 or 4 1/8 inches
Created May 31, 2016
My solution to CS50 pset2 - "Initializing"
View initials.c
 #include #include #include #include /** * * Write, in a file called initials.c, a program that prompts a user for * their name (using GetString to obtain their name as a string) and then * outputs their initials in uppercase with no spaces or periods,
Created Jul 7, 2016
CS50 pset4 - "Whodunit"
View whodunit.c
 /** * whodunit.c * * Computer Science 50 * Problem Set 4 * * Copies a BMP piece by piece, with slight variation. */ #include
Created Jun 1, 2016
My solution to CS50 pset2 - "Parlez-vous français?"
View vigenere.c
 #include #include #include #include /** * Vigenere.c * * A program that encrypts messages using Vigenère’s cipher. This program * must accept a single command-line argument: a keyword, k, composed entirely
Last active Oct 17, 2019
Bubble Sort in Javascript
View bubbleSort.js
 // Normal const bubbleSort = function(array) { let swaps; do { swaps = false; for (let i = 0; i < array.length - 1; i++) { if (array[i] > array[i + 1]) { let temp = array[i + 1]; array[i + 1] = array[i]; array[i] = temp;