Skip to main content

I completed my CS50x in 3 months and sharing of my brainstormed ideas for final project

It is official!! I submitted my final project and completed the CS50x: Introduction to Computer Science. I completed the week 9 assignment last Friday. The assignment involves building a web browser on Flask that allowed users to register, log in, view profiles, quote stock prices through an API on an exchange site and lastly make transactions of buying or selling of the stocks. This project really took a while as I was not familiar with HTML and CSS. I am lucky that this project makes use of python and SQL, which I am more comfortable with, instead of javascript. 

I started on some projects ideas this Monday.

Idea 1 - a table form to get students' input for their multiple choice question answers. 

I teach tuition and do not want to mark their MCQ, scrolling through their pages. I had tried google form but find it tedious to key in the answers for 40MCQ in order for the students to know the correct answers after they had submitted their results. However google form is useful that it allow me to see their collective response per question. I gave this idea some thought and tried google sheets, conditional formating of student's cells against the answer key. I can only fit 4 tables visibly in one sheet but that works for me since I only have 4 students in the class. I suppose if I had more students then the effort to create that google form will justify itself. Thus the conclusion was I found my solution through google sheet tables and do not feel I need to recreate the wheel using HTML, CSS and python.

Idea 1 - scrapped.

Idea 2 - create an app that turns photos into pixel art C2C charts. Count the number of squares for each colour and calculate the amount of yarn required depending on the number of squares.

I had been toying with this idea for ages since I crochet and thought this is doable since it is just math. I found some good pixel art converter websites. I experimented with different photos and hit a major issue, normal photos have too many details, to pixelate means to lose all these details such that the image may not be recognizable or aesthetically pleasing after the conversion. To keep the details will mean to work with a gradient of colours and that will probably make the whole image complicated and the end product too big. This means the pixel art converted from a photo is a good idea but is not very useful. The math part has too many variables as well since the size of the end product depends on each C2C square and the size of each C2C square depends on the tension and yarn used. So again the math may come out to be a guide which is not too useful as well. 

Idea 2 - scrapped since the app is probably not going to be useful at all.

Idea 3 - command line game using python

I watched a video on using LOVE LUA to create a simple 2D game and the instructor mentioned that we can create one in 2 weeks. I do not have so much time and I only love playing exploratory games which are impossible since I need to think of a storyline and scenarios. I looked through my cs50x assignments to see if there are any projects that I can reuse and saw that we had done compute scores of words using the scrabble scoring before. It was done in C programming which means it will be easier to replicate in python and thus I set about recreating my scrabble game. 

I read the rules of scrabble and broke down the scrabble mechanics as follows:

1) create the main stash of 100 tiles made up of various letters. 
I made a dictionary for this. 

2) deal 7 random tiles to the player.
I used random.choice on the dictionary for the 100 tiles.

3) get player input on their word, check if word can be formed from tiles in the player's hand and if such a word exists then compute the score of the word.
I found a dictionary API for this and I even went on to extract one meaning for display.

4) store and compare players' total scores to see who is the winner.

5) create a player class object to store all relevant details of a player such as the tiles on hand, the total score and the name.
This allowed users to decide on the number of players at the start and create multiple players. 

6) players can perform actions such as swapping the tiles from the main stash or checking a word.
I had to make sure that the tiles in the player's hand are removed, replenished with fresh tiles from the stash and these swapped tiles back to the main stash.

7) given the power of the player object, I went on further to create a dictionary to store the words and scores of each word created by the player for later use when displaying the winner and their highest scoring word. 

As I was making this game, I got a bit concerned about how being able to add to other's players' words is the real complexity and fun of scrabble. However, in the end, I decided that I was just going to work on it at this scale and submitted a fully functioning command-line game complete with ASCII art that can be played on a terminal window.

I even went ahead to incorporate clearing the terminal window so the next player does not see the previous player's tiles and import the time module to pause before the screen is clear to ensure players get to see the outcome of their actions before the screen is cleared.

Overall, I am super happy with the functions in my scrabble game. 

So happy in fact that I went on to purchase an "I took CS50" shirt from the CS50 shop! It is probably the most expensive t-shirt that I ever bought but I felt I had earned it! 

If you are thinking if CS50 is worth it, it is definitely worth it.  

And this was my cs50!

Comments