Created
February 23, 2016 14:58
-
-
Save cerberusiscute/f6015ba61ef30e7a3e1b to your computer and use it in GitHub Desktop.
This file contains 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
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