Skip to content

aexg/slsw_ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Seven Languages in Seven Weeks - Ruby

Day 1: Findning a Nanny (2019-07-10)

To remember

  • 0 is logical true.
  • all parts of logical expression with | and & are evaluated.

Created code

guessnumber.rb: game where player have to guess a number from 1 to 10.

Day 2: Floating Down from the Sky (2019-07-11)

To remember

  • yeld in caller calls the code block.

Created code

  • fourperline.rb: print content of an array of sixteen numbers, four numbers at a time, using just each. Than do the same with each_slice in Enumerable.
  • hashtotree.rb: a Tree class with initializer accepting nested structure with hashes and arrays like this: { 'grandpa' => { 'dad' => { 'child 1' => {}, 'child 2' => {} }, 'uncle' => { 'child 3' => {}, 'child 4' => {} } } }.
  • simplegrep.rb: a simple grep that prints lines of file containing a phrase in that line using a regex match, include line numbers. Example of usage: ./simplegrep.rb loremipsum.txt "int[a-z]ger"

Day 3: Serious Change (2019-07-12)

To remember

  • n/a

Created code

  • csvrow.rb: modified csv sample application to support an each method to return CsvRow object using methon_missing at CsvRow to return the value for column for a given heading.

(eof)

About

Seven Languages in Seven Weeks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages