# run "ruby cipher.rb" # It will ask for a string (use upper case letters) # It will ask for a shift and then output the encrypted string print "Enter a string:" x=gets print "Enter a shift:" shift=Integer(gets) y=String.new (x.length-1).times{|i| y << ((x[i]-65 + shift) % 26 + 65) } puts y