{"id":18049613,"url":"https://github.com/iacobson/odin7-ruby-building_blocks","last_synced_at":"2025-04-05T06:15:19.386Z","repository":{"id":27789005,"uuid":"31277885","full_name":"iacobson/Odin7-Ruby-Building_Blocks","owner":"iacobson","description":null,"archived":false,"fork":false,"pushed_at":"2015-02-26T14:26:25.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T02:36:55.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"nstoker/MIT_Licence","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iacobson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-24T19:33:54.000Z","updated_at":"2015-02-26T14:26:25.000Z","dependencies_parsed_at":"2022-07-26T10:02:01.672Z","dependency_job_id":null,"html_url":"https://github.com/iacobson/Odin7-Ruby-Building_Blocks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2FOdin7-Ruby-Building_Blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2FOdin7-Ruby-Building_Blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2FOdin7-Ruby-Building_Blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2FOdin7-Ruby-Building_Blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iacobson","download_url":"https://codeload.github.com/iacobson/Odin7-Ruby-Building_Blocks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294567,"owners_count":20915341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T21:08:16.946Z","updated_at":"2025-04-05T06:15:19.365Z","avatar_url":"https://github.com/iacobson.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Odin7-Ruby-Building_Blocks\n#### http://www.theodinproject.com/ruby-programming/building-blocks\n\n##Project 1: Caesar Cipher\n\n_From_Wikipedia_:\n\nIn cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.\n\n**TASK:** Implement a caesar cipher that takes in a string and the shift factor and then outputs the modified string:\n**caesar_cipher(input_string, shift_factor)**\n\n##Project 2: Stock Picker\nImplement a method #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.\n\n```ruby\nstock_picker([17,3,6,9,15,8,6,1,10])\n=\u003e [1,4]  # for a profit of $15 - $3 == $12\n```\n\n##Project 3: Substrings\nImplement a method #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.\n```ruby\ndictionary = [\"below\",\"down\",\"go\",\"going\",\"horn\",\"how\",\"howdy\",\"it\",\"i\",\"low\",\"own\",\"part\",\"partner\",\"sit\"]\n=\u003e [\"below\",\"down\",\"go\",\"going\",\"horn\",\"how\",\"howdy\",\"it\",\"i\",\"low\",\"own\",\"part\",\"partner\",\"sit\"]\n\nsubstrings(\"below\", dictionary)\n=\u003e {\"below\"=\u003e1, \"low\"=\u003e1}\n```\nNext, make sure your method can handle multiple words:\n```ruby\nsubstrings(\"Howdy partner, sit down! How's it going?\", dictionary)\n=\u003e {\"down\"=\u003e1, \"how\"=\u003e2, \"howdy\"=\u003e1,\"go\"=\u003e1, \"going\"=\u003e1, \"it\"=\u003e2, \"i\"=\u003e 3, \"own\"=\u003e1,\"part\"=\u003e1,\"partner\"=\u003e1,\"sit\"=\u003e1}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiacobson%2Fodin7-ruby-building_blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiacobson%2Fodin7-ruby-building_blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiacobson%2Fodin7-ruby-building_blocks/lists"}