From 209f84b2e99621e39f1be602ddca6bc1a1a003f5 Mon Sep 17 00:00:00 2001 From: JeffreyMPrice <108019276+JeffreyMPrice@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:48:05 -0500 Subject: [PATCH] Ruby: Project: Caesar Cipher: Fix Ruby Caesar Cipher code example (#29107) * 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. * 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruby/basic_ruby_projects/project_caesar_cipher.md b/ruby/basic_ruby_projects/project_caesar_cipher.md index 9f543abcc8f..557ae29a8b8 100644 --- a/ruby/basic_ruby_projects/project_caesar_cipher.md +++ b/ruby/basic_ruby_projects/project_caesar_cipher.md @@ -18,7 +18,7 @@ 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) @@ -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.