/cs50

Harvard's intro to computer science course.

Primary LanguageC

cs50

Harvard's intro to computer science course.

Excercises completed

Pset1

  1. Hello: print "hello, world."
  2. Mario (more comfortable): print hashtags in shapes that look like the pyramids in Mario.
  3. Credit: check if given card numbers are valid.

Pset2

  1. Caesar: encoded a string with a Caesar cipher (shift letters by a given amount).
  2. Crack: crack hashed passwords up to 5 characters long.

Pset3 (2018)

  1. Music (from 2018 course): modify a file distribution to add functionality to output the frequency of musical notes (eg A4 = 440Hz).
Note at this point the course was updated from its 2018 to 2019 versions. The test scores for the above Psets were carried over, except for Music which isn't on the course anymore.

Pset3 (2019)

  1. Whodunit: modify the bytes of a bitmap image file to change the colour of red pixels to reveal a message hidden in the noise.
  2. Resize (more comfortable): modify the headers and pixels of a bitmap file to increase or decrease its size.
  3. Recover: find 50 JPEG files on a memory card by searching for the starting bytes of JPEG images.

Pset4

  1. Speller (trie implementation): store the words of a dictionary in a trie and then search the trie to see if passed words are spelt right. Also created functions to recursively count the words in the trie and recursively free the memory used by it at the end.

Pset5

  1. Homepage: create a small website with 4 pages. (Please don't judge me on this, I thoroughly half arsed it and just met the minimum requirements.)

Pset6

  1. Hello: redo Hello from pset1 in python.
  2. Mario (more comfortable): redo Mario from pset1 in python.
  3. Credit: redo Credit from pset1 in python.
  4. Crack: redo Crack from pset2 in python.
  5. Bleep: read in a text file of banned words then censor those words with *s if they appear in a users input string.

Pset7

  1. Similarities: create a form that could accept file inputs from user and write functions for splitting the text in them into lines, sentences or ngrams.
  2. Survey: With Flask for Python make a site that can accept user inputs from a validated form, save them on the server in a csv then show the csv contents to the user in a table.

Pset8

  1. Finance: build out a website with Flask, Bootstrap and SQLite that allows users sign up, log in and then buy or sell stocks on multiple forms and webpages.

Final Project

Stock market gamification. Repo here and playable version here.

Built off the pset8 to make a game from the stock market data pulled from IEX's api. Logos from companies on the Nasdaq 100 move with the stock price movements from the last full trading day. You play a little spaceman trying to jump up these stocks and sit on rising stocks to make money.

The game front end was made with the Phaser 3 Javascript library and it runs on a Flask server. I ran that in an Alpine Linux Docker container and hosted it on AWS ECS. The highscores are kept in a MongoDB on Mongo Atlas.