{"id":16157456,"url":"https://github.com/kwchang0831/theodinproject_exercise_ruby","last_synced_at":"2025-09-04T04:17:29.859Z","repository":{"id":226440937,"uuid":"768672470","full_name":"kwchang0831/theodinproject_exercise_ruby","owner":"kwchang0831","description":"Exercises Solution for theodinproject","archived":false,"fork":false,"pushed_at":"2024-03-12T05:29:21.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T01:42:11.537Z","etag":null,"topics":["ruby","theodinproject"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwchang0831.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-07T14:20:39.000Z","updated_at":"2024-03-07T15:31:13.000Z","dependencies_parsed_at":"2024-03-12T05:46:20.286Z","dependency_job_id":null,"html_url":"https://github.com/kwchang0831/theodinproject_exercise_ruby","commit_stats":null,"previous_names":["kwchang0831/theodinproject_exercise_ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kwchang0831/theodinproject_exercise_ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwchang0831%2Ftheodinproject_exercise_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwchang0831%2Ftheodinproject_exercise_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwchang0831%2Ftheodinproject_exercise_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwchang0831%2Ftheodinproject_exercise_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwchang0831","download_url":"https://codeload.github.com/kwchang0831/theodinproject_exercise_ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwchang0831%2Ftheodinproject_exercise_ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273549306,"owners_count":25125275,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ruby","theodinproject"],"created_at":"2024-10-10T01:49:34.327Z","updated_at":"2025-09-04T04:17:29.837Z","avatar_url":"https://github.com/kwchang0831.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [TheOdinProject](https://www.theodinproject.com/) Excercise : Ruby\n\n## to Test\n\nInstall RSpec\n\n```shell\ngem install rspec\n```\n\nRun Tests\n\n```shell\nrspec\n```\n\n## [Caesar Cipher](lib/caesar_cipher.rb)\n\nImplement a method [#caesar cipher](https://www.theodinproject.com/lessons/ruby-caesar-cipher) that takes in a string and the shift factor and then outputs the modified string:\n\n```irb\ncaesar_cipher(\"What a string!\", 5)\n=\u003e \"Bmfy f xywnsl!\"\n```\n\n## [Substrings](lib/substrings.rb)\n\nImplement a method [#substrings](https://www.theodinproject.com/lessons/ruby-sub-strings) 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\n```irb\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\"]\nsubstrings(\"below\", dictionary)\n=\u003e { \"below\" =\u003e 1, \"low\" =\u003e 1 }\n```\n\nNext, make sure your method can handle multiple words:\n\n```irb\nsubstrings(\"Howdy partner, sit down! How's it going?\", dictionary)\n=\u003e { \"down\" =\u003e 1, \"go\" =\u003e 1, \"going\" =\u003e 1, \"how\" =\u003e 2, \"howdy\" =\u003e 1, \"it\" =\u003e 2, \"i\" =\u003e 3, \"own\" =\u003e 1, \"part\" =\u003e 1, \"partner\" =\u003e 1, \"sit\" =\u003e 1 }\n```\n\n## [Stock Picker](lib/stock_picker.rb)\n\nImplement a method [#stock_picker](https://www.theodinproject.com/lessons/ruby-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```irb\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## [Bubble Sort](lib/bubble_sort.rb)\n\nBuild a method [#bubble_sort](https://www.theodinproject.com/lessons/ruby-bubble-sort) that takes an array and returns a sorted array. It must use the bubble sort methodology (using #sort would be pretty pointless, wouldn’t it?).\n\n```irb\n\u003e bubble_sort([4,3,78,2,0,2])\n=\u003e [0,2,2,3,4,78]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwchang0831%2Ftheodinproject_exercise_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwchang0831%2Ftheodinproject_exercise_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwchang0831%2Ftheodinproject_exercise_ruby/lists"}