From 73729521d3ae200a838ef3c1d295080bdf22ae40 Mon Sep 17 00:00:00 2001 From: JeffreyMPrice <108019276+JeffreyMPrice@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:05:15 -0500 Subject: [PATCH 1/2] Caesar_cipher code example showed right shift, not left. A left shift of 5 for the string "What a string" should yield the value "Rcvo v nomdib!". The output in the example shows a right shift of 5. At the very least, the example from Wikipedia shows a left shift of three, "D->A" and "E->B" while the code example shows a right shift. The examples should be consistent on the page. --- ruby/basic_ruby_projects/project_caesar_cipher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/basic_ruby_projects/project_caesar_cipher.md b/ruby/basic_ruby_projects/project_caesar_cipher.md index 9f543abcc8f..76bb655e195 100644 --- a/ruby/basic_ruby_projects/project_caesar_cipher.md +++ b/ruby/basic_ruby_projects/project_caesar_cipher.md @@ -22,7 +22,7 @@ Harvard's CS50 class has a [video about the Caesar cipher](https://www.youtube.c ```ruby > caesar_cipher("What a string!", 5) - => "Bmfy f xywnsl!" + => "Rcvo v nomdib!" ``` **Quick Tips:** From deb4f9cca2cc279879dc3a3648faa3faa719284b Mon Sep 17 00:00:00 2001 From: JeffreyMPrice <108019276+JeffreyMPrice@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:55:42 -0500 Subject: [PATCH 2/2] Add instructions for right shift * Add to project instructions using a right shift * Add to quick tips that Wikipedia shows a left shift * Fix lower case ceaser --- ruby/basic_ruby_projects/project_caesar_cipher.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruby/basic_ruby_projects/project_caesar_cipher.md b/ruby/basic_ruby_projects/project_caesar_cipher.md index 76bb655e195..557ae29a8b8 100644 --- a/ruby/basic_ruby_projects/project_caesar_cipher.md +++ b/ruby/basic_ruby_projects/project_caesar_cipher.md @@ -18,11 +18,11 @@ Harvard's CS50 class has a [video about the Caesar cipher](https://www.youtube.c
- Implement a caesar cipher that takes in a string and the shift factor and then outputs the modified string: + Implement a Caesar cipher that takes in a string and the shift factor and then outputs the modified string using a right shift: ```ruby > caesar_cipher("What a string!", 5) - => "Rcvo v nomdib!" + => "Bmfy f xywnsl!" ``` **Quick Tips:** @@ -30,5 +30,6 @@ Harvard's CS50 class has a [video about the Caesar cipher](https://www.youtube.c - You will need to remember how to convert a string into a number. - Don't forget to wrap from `z` to `a`. - Don't forget to keep the same case. +- The Wikipedia quote discusses a Caesar cipher using a left shift.