CS50x Week 4: Breakout (Problem set)

GUI (Graphical User interface) is interface that interacts with user through graphics as opposed to text user interface that interacts through text. For example, a game of tetris uses the GUI, while old game such as Discworld MUD uses text user interface. This week, we used an API (Application programming interface) provided by SPL (Stanford … Continue reading CS50x Week 4: Breakout (Problem set)

6.00.1x Week 3 (Problem Set)

There are two problems in this week’s problem set, one requires us to calculate the radiation exposure, another one requires us to program a hangman game. Radiation exposure Radioactive substance will undergo radioactive decay and emit radiation, over time, the amount of radioactive substance will reduce. The time required for a radioactive substance to reduce … Continue reading 6.00.1x Week 3 (Problem Set)

6.00.1x Week 3

This week, we learnt about recursion and different compound data types. Recursion Recursion means repeating similar version of something. In programming, a recursion function is a function that calls a smaller version of itself. It is useful for problems that can be represented as smaller version of themselves. The concept of recursion can be condensed … Continue reading 6.00.1x Week 3

CS50x Week 3: Game of Fifteen

This week I learned different sorting and searching algorithms. Sorting means arranging the elements in an array in ascending or descending order. Searching means finding an element in an array. Sorting algorithms Bubble sort Selection sort Insertion sort Quick sort Searching algorithms Binary search Bubble sort Imagine you have a list of numbers, from left … Continue reading CS50x Week 3: Game of Fifteen

6.00.1x Week 2

In week 2, I learnt to write functions in Python. The format of function in Python is as follows:

whereas in C, it is written as:

To program a basic function such as function to find the square root of a number, there are many approaches. We can use: 1. Linear search (exhaustive … Continue reading 6.00.1x Week 2

Starting MITx 6.00.1x Introduction to Computer Science and Programming Using Python 2014

I started another OpenCourseWare (free online course), MITx: 6.00.1x Introduction to Computer Science and Programming Using Python, provided by MIT and hosted on edX. I am currently also learning C with CS50x. When I was trying out the Project Euler questions, I realised that C cannot compute very large numbers, while Python can do it … Continue reading Starting MITx 6.00.1x Introduction to Computer Science and Programming Using Python 2014

CS50x Week 1: C

I have learnt about libraries, compilers, switch statements, and typecasting. When we are programming, we are giving instructions to the computer to carry out tasks. However, the programming language like C is considered a high level language. High level language is easy to read (resembles english), while low level language is cryptic. Computers only read … Continue reading CS50x Week 1: C