Skip to content

Instantly share code, notes, and snippets.

@cerberusiscute
Created February 23, 2016 14:58
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 cerberusiscute/f6015ba61ef30e7a3e1b to your computer and use it in GitHub Desktop.
Save cerberusiscute/f6015ba61ef30e7a3e1b to your computer and use it in GitHub Desktop.
def main
puts "enter your sigil phrase or word"
line = gets.chomp.squeeze!
arr = line.gsub!(/\s/, '').chars
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
arr = arr - to_remove
i = 1
while i < line.length - 1
temp = nil
slot_one = nil
slot_two = nil
slot_one = rand(1..arr.length - 1).to_i
slot_two = rand(1..arr.length - 1).to_i
temp = arr[slot_one]
arr[slot_one] = arr[slot_two]
arr[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