Foundations of Computer Science
& Numerical Methods 17-18

Additional Resources

Lessons

  1. [20180222] Bash & Intro to Ruby (.rb, puts, '', "")
  2. [20180226]
    Topics:
    • String interpolation.
    • Mathematical operators (and int vs float).
    • A gentle introduction to the math library.
    • The first function (with hints on scopes).
    • Variables (with hints on scopes).
    • Bash input - output.
    This executable ruby script contains, in the form of comments, the theory saw in class alongside some examples. Note: the file has extension ".txt" only to allow reading it from the browser.
  3. [20180305]
    Topics:
    • Recap on math operators.
    • Boolean variables and expressions.
    • Conditional execution.
    • Input from the user.
    • Range
    This executable ruby script contains, in the form of comments, the theory saw in class alongside some examples. Note: the file has extension ".txt" only to allow reading it from the browser.
  4. [20180312]
    Topics:
    • Loops, break, next.
    • Example: Method of Exhaustion for the Area of the Circle .
    • Recursive function.
    • Example: Factorial.
    • Exercise: "Move O around" (solution next lesson).
    This executable ruby script contains, in the form of comments, the theory saw in class alongside some examples. Note: the file has extension ".txt" only to allow reading it from the browser.
  5. [20180319]
    Topics:
    • Example: "Move O around" - (solution).
    • Array - doc.
    • Example: "Screen via Array" - (code).
    • OOP: class, instance, method, instance's variable, initialize.
    • Example: "Screen as class" - (code).
  6. [20180322]
    Topics:
  7. [20180326]
    Topics:
    • OOP Recap; Encapsulation; Inheritance; Polymorphism - (pdf).
    • Classes: Object, Numeric, Array, Strings, Hash, File - (doc).
    • Exercise 1: Read numbers from a file and sort them - (solution).
    • Exercise 2: Read numbers from a file and count occurrences.
  8. [20180409]
    Topics:
    • Solution to 0326 exercise 2 - (solution).
    • Sorting (<0, 0, >0). Note: 0 is True in Ruby.
    • Methods and attributes visibility: public, protected, private.
    • Introduction to attributes accessibility: getter & setter.
    • Enumerable mixin.
    • Design of our Matrix class.
  9. [20180416]
    Topics:
    • Attributes accessibility: getter & setter - (examples)
    • Matrix implementation draft
    • Assignment: Write tests (simple code that uses the class features) and debug it - (broken_matrix).
  10. [20180423]
    Topics:
  11. [20180507]
    Topics:
  12. [20180514]
    Topics:
  13. [20180521]
    Topics:
  14. [20180528]
    Topics:
    • Exam simulation.

Mails

When contacting me, please use an appropriate subject like '[CNUM 1718] ...' and, before sending in your questions, double check for the answers not to be already in the Google Classroom.