Giter Site home page Giter Site logo

caesar_cipher's Introduction

Caesar Cipher

Using this repo, build a well tested Ruby program that translates a message using the Caesar Cipher.

You can read more about the Caesar Cipher here.

Note: We are shifting left. So if we shift 3, A is now X, D is now A and so forth.

Submission instructions

  1. Fork the repo above
  2. Clone your fork
  3. Push your solution to your fork
  4. Use Github's interface to create a pull request

Iteration 0

Translate English to ciphertext

  • lowercase letters
  $ caesar = Caesar.new 
  => #<Caesar:0x007fa1ab98cac0>
  $ caesar.eng_to_cipher("the quick brown fox jumps over the lazy dog", 3) 
  => "qeb nrfzh yoltk clu grkmp lsbo qeb ixwv ald"

Iteration 1

Translate English to ciphertext

  • Case sensitivity
$ caesar = Caesar.new
=> #<Caesar:0x007fa1ab98cac0>
$ caesar.eng_to_cipher("The quick brown fox JUMPS over the lazy DOG", 3) 
=> "Qeb nrfzh yoltk clu GRKMP lsbo qeb ixwv ALD"

Iteration 2

Translate English to ciphertext

  • from a file
# in input.txt
I am in a file
  $ caesar = Caesar.new 
  => #<Caesar:0x007fa1ab98cac0>
  $ caesar.from_file("input.txt")
  => "F xj fk x cfib "

Iteration 3

Translate ciphertext to English

  $ caesar = Caesar.new 
  => #<Caesar:0x007fa1ab98cac0>
  $ caesar.cipher_to_eng("qeb nrfzh yoltk clu grkmp lsbo qeb ixwv ald") 
  => "the quick brown fox jumps over the lazy dog"

caesar_cipher's People

Contributors

jamisonordway avatar mikedao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.