This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function railFenceCipher(operation, string, height = 3) { | |
function performOperation(operation, string, height, lines) { | |
let results = ''; // only for decrypt | |
let currentLine = 0; | |
let moveUp = true; | |
let moveDown = false; | |
for (let i = 0; i < lines[0].length; i += 1) { | |
if (operation === 'encrypt') { | |
lines[currentLine].splice(i, 1, string[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*********** | |
**PROBLEM** | |
*********** | |
**INPUT** | |
Upon form submission an array like the following is provided as a value to a key in Sinatra's params hash | |
[{"job_id"=>"43", "new_order"=>""}, | |
{"job_id"=>"44", "new_order"=>""}, | |
{"job_id"=>"46", "new_order"=>""}, | |
{"job_id"=>"47", "new_order"=>""}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qas = %w[holden darius curt ryan1 ryan2 ryan3] | |
puts qas.delete(qas.sample) until qas.empty? |
OlderNewer