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
require 'digest/sha1' | |
class SHA1Breaker | |
@@chars = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ".split("") | |
@@nums = "1234567890".split("") | |
@@lower = "abcdefghijklmnopqrstuvwxyz".split("") | |
def self.breaker(hash) | |
self.guesser(hash, @@chars) | |
end |
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
class RPS | |
# Rock, Paper, Scissors | |
# Make a 2-player game of rock paper scissors. It should have the following: | |
# | |
# It is initialized with two strings (player names). | |
# It has a `play` method that takes two strings: | |
# - Each string reperesents a player's move (rock, paper, or scissors) | |
# - The method returns the winner (player one or player two) | |
# - If the game is over, it returns a string stating that the game is already over | |
# It ends after a player wins 2 of 3 games |
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
def change a | |
smallcase = 'a'..'z' # smallcase.to_a.size #=> 26 | |
zeros = ("%026d" % 0).chars # creates array of 26 zeros | |
check = Hash[smallcase.zip(zeros)] #create hash map of alphabet to zeros | |
b = a.chars.each {|x| x.downcase!} | |
b.each do |x| | |
if check.include?(x) | |
check[x] = 1 | |
end |
NewerOlder