Beginners

Stretching - for beginners

OK, if you believe you’re a beginner and need to warm-up, here’s a list of tasks to do using ruby before starting this book.

  • Strings
    • Print the following string \x52\x75\x62\x79\x46\x75 as it is, it should NOT be resolved to characters.
    • You have string RubyFu , convert this string to an array (each character is an element).
  • Arrays
    • You have the following array ["R", "u", "b", "y", "F", "u"] convert it to string RubyFu.
    • You have the following array ["1", "2", "3", "4"], calculate the sum of all elements.
  • Files and Folders
    • Find all files ending with .jpg or .pdf or .docx or .zip in your Downloads folder.
    • Create a folder called ruby-testfu and copy all found files (from the previous task) into it.
  • Network
    • Create a simple TCP server listening on port 3211. This server prints date and time.
    • Create a simple TCP client to connect to the previous server and print what the server sends.

A good list of References can be found under the Beginner section.

Challenge Yourself!

There are some awesome websites that push your programming skills via interactive challenges and I really encourage you to go through one or more of them.