Skip to content

katarzyna-starachowicz/ruby_building_blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby_building_blocks

My task was to write 3 methods.

  1. Caesar cipher that takes in a string and the shift factor and then outputs the modified string.
  2. Stock picker that takes in an array of stock prices, one for each hypothetical day. It should return a pair of days representing the best day to buy and the best day to sell. Days start at 0.
  3. Substrings that takes a word as the first argument and then an array of valid substrings (your dictionary) as the second argument. It should return a hash listing each substring (case insensitive) that was found in the original string and how many times it was found.

I wrote also tests (rspec) for them. Firstly, I used old version (with "should"). Later I learned about new documentation and I refactored test for Caesar cipher.

The Odin Project, http://www.theodinproject.com/ruby-programming/building-blocks

About

#caesar_cipher, #stock_picker, #substrings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages