Skip to content

Instantly share code, notes, and snippets.

@leejarvis

leejarvis/x.rb Secret

Created February 23, 2016 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leejarvis/d0bda7a44ec4b4be9f81 to your computer and use it in GitHub Desktop.
Save leejarvis/d0bda7a44ec4b4be9f81 to your computer and use it in GitHub Desktop.
def main
puts "enter your sigil phrase or word"
line = gets.chomp.squeeze!.to_a
p line
puts "with [1] or without [0] 'y'"
y_choice = gets.chomp.to_i
to_remove = [ "a", "e", "i", "o", "u" ]
if y_choice == 0
to_remove.push("y")
end
p to_remove
line = line - to_remove
p line
i = 1
while i < line.length - 1
temp = nil
slot_one = nil
slot_two = nil
slot_one = rand(1..line.length - 1).to_i
slot_two = rand(1..line.length - 1).to_i
p slot_one, slot_two
temp = line(slot_one)
line(slot_one) = line(slot_two)
line(slot_two) = temp
i += 1
end
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment