Thomas Baldock
Melbourne, Australia -
day, month 00 0000
View number: loading...
Certified Cloud Practioner BadgeAWS Re/Start Graduate Badge


Wednesday, 5th of October

The Shell Game

The Shell Game

Just a quick one here. I have started cs50's Introduction to Computer Science and made it through week 0. In this block we were introduced to the fundamental concepts of computer science.

We touched on how the binary system is used to represent all kinds of information e.g. text, images, videos, sounds, emojis, etc on computers. We learnt computer science can be simplified into two components - inputs and outputs, and that essentially, computer science is a form of problem solving, using algorithms (step-by-step instructions on how to process inputs to produce required outputs).

Through a basic example (finding a name in a phone book) we visualised how an algorithm's efficiency can be calculated. We used this example to show how an algorithm's efficiency can be represented using a simple chart.

Algorithmic-efficiency
We then experminted with writing 'pseudocode' using quasi functions (pick up), conditionals (if, else if), loops (for, return to line x) and boolean expressions (is person on page? yes or no). The pseudocode that was used to find any name in the phone book was this:

1  Pick up phone book
2  Open to middle of phone book
3  Look at page
4  If person is on page
5   Call person
6  Else if person is earlier in book
7   Open to middle of left half of book
8   Go back to line 3
9  Else if person is later in book
10   Open to middle of right half of book
11   Go back to line 3
12  Else
13   Quit

The lecture finished with an introduction to the graphical programming language called Scratch, developed by MIT. This language has a highly human-readable form and bridges the gap between pseudocode and computer code. We had a look at some examples of previous student's projects, before we were sent out into the ether to come up with and execute our own idea.

After a short time experimenting with the language, I decided to recreate the Shell Game in Scratch. Here's my finished project.






I've had some experience making a small game with python (battleship) however, this time my efforts were unguided. Admittedly, Scratch is very intuitive - still, working through the entire process helped reinforce some concepts for me. Most notably - the concept of exit status. It took some time for me to work how to integrate the seperate 'puzzle pieces' of my project, until I discovered the 'broadcast message' feature of Scratch. From this point, it was much clearer how I could integrate my puzzle pieces together.

I had a lot of fun with this week's block - particularly David J. Malan's energetic stage presence. He seems to me to be the Freddie Mercury of the Computer Science world! I'm really looking forward to next week's learning.