Skip to content

Instantly share code, notes, and snippets.

View jonenzl's full-sized avatar

Jonathan Ellis jonenzl

View GitHub Profile
@jonenzl
jonenzl / whodunit.c
Last active January 31, 2023 16:03
My implementation of CS50x Pset4 - Whodunit
/****************************************************************************
* whodunit.c
*
* HarvardX - CS50
* Problem Set 4
*
* Change the colour of a BMP's pixels to reveal a hidden message
***************************************************************************/
#include <stdio.h>
@jonenzl
jonenzl / Password Generator - C#
Last active October 3, 2022 20:35
A simple password generator built with C# in Visual Studio, using WPF and the .Net Framework 4.5
using System;
using System.Text;
using System.Windows;
namespace Password_Generator
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
@jonenzl
jonenzl / resize.c
Last active August 20, 2022 13:54
My implementation of CS50x Pset4 - Resize
/****************************************************************************
* resize.c
*
* HarvardX - CS50
* Problem Set 4
*
* Resize a BMP image by a factor of n
***************************************************************************/
#include <stdio.h>
@jonenzl
jonenzl / dictionary.c
Created June 21, 2017 04:59
My implementation of CS50x Pset5 - Speller
/****************************************************************************
* dictionary.c
*
* Computer Science 50
* Problem Set 5
*
* Implements a dictionary's functionality.
***************************************************************************/
#include <ctype.h>
@jonenzl
jonenzl / euclid.c
Last active June 11, 2017 01:27
Determine the greatest common divisor of two integers using Euclid's algorithm
/****************************************************************************
* euclid.c
*
* Determine the greatest common divisor of two integers using Euclid's algorithm
*
* usage: ./eculid num1 num2
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
@jonenzl
jonenzl / fifteen.c
Last active June 11, 2017 00:56
My implementation of CS50x Pset3 - Game of Fifteen
/****************************************************************************
* fifteen.c
*
* HarvardX - CS50
* Problem Set 3
*
* Implements Game of Fifteen (generalized to d x d).
*
* Usage: fifteen d
*
@jonenzl
jonenzl / vigenere.c
Last active June 11, 2017 00:54
My implementation of CS50x Pset2 - Vigenere Cipher
/****************************************************************************
* vigenere.c
*
* HarvardX - CS50
* Problem Set 2
*
* Encipher text using Vigenere's algorithm (ci = (pi + kj) % 26)
***************************************************************************/
#include <cs50.h>
@jonenzl
jonenzl / search.c
Last active June 11, 2017 00:53
Two searching functions - Linear search (O(n)) and binary search (O(log n))
/****************************************************************************
* search.c
*
* HarvardX - CS50
*
* Two search functions. Linear search and binary search
***************************************************************************/
/**
* Linear search function
@jonenzl
jonenzl / sort.c
Last active June 11, 2017 00:52
Three sorting functions - bubble sort (O(n^2)), selection sort (O(n^2)), and counting sort (O(n))
/****************************************************************************
* sort.c
*
* HarvardX - CS50
*
* A selection of sorting functions
* Bubble sort, selection sort, and counting sort
***************************************************************************/
/**
@jonenzl
jonenzl / arc_distance.c
Created June 6, 2017 05:36
Calculates the distance between two GPS points using the Law of Haversines
/****************************************************************************
* arc_distance.c
*
* Calculates the distance between two GPS points using the Law of Haversines
***************************************************************************/
#include <stdio.h>
#include <math.h>
#define pi 3.14159265358979323846