Skip to content

Instantly share code, notes, and snippets.

View jeffreybaird's full-sized avatar

Jeffrey Baird jeffreybaird

View GitHub Profile
@jeffreybaird
jeffreybaird / subtract_letters.rb
Created May 25, 2012 04:48 — forked from agoodman/subtract_letters.rb
Word Pruning by Letter Subtraction
possible_words = ["seek", "find", "ignore", "pursue", "covet"]
available_letters = [ "w5","g6","f7","s2","e1","l3","h8","n1","f7","b8","r12","u3","g6","i4","q9","o3","d2","s2","f7"]
words = Array[possible_words].flatten
available_letters = tiles.map {|e| e[0]}
available_letters.each {|e| words = words.map {|w| w.sub(e, '')}}
viable_words = words.each_with_index.collect {|w,k| possible_words[k] if w==""}.compact
letter_value_hash = Hash[tiles.map {|l| [l.slice(0), l.slice(1..3).to_i]}]
word_as_values = viable_words.map do |word|
require 'oauth_util.rb'
require 'net/http'
o = OauthUtil.new
o.consumer_key = 'examplek9SGJUTUpocjZ5QjBJmQ9WVdrOVVFNHdSR2x1TkhFbWNHbzlNQS0tJnM9Y29uc3VtkZXJzZWNyZXQmeD0yYg--';
o.consumer_secret = 'exampled88d4109c63e778dsadcdd5c1875814977';
url = 'http://query.yahooapis.com/v1/yql?q=select%20*%20from%20social.updates.search%20where%20query%3D%22search%20terms%22&diagnostics=true';
#CLASS/INSTANCE METHODS AND VARIABLES PRACTICE:
# ADD YOUR CODE TO THIS FILE
#
#1. Class/Methods
# -create a class called Project
# -create a class variable called count
# -create a instance method called "say_class_name" that prints name of the class
#2.Instance Variables/Class Variables/Constants
# - create a class method to return @@count
# - give it the instance variables title, description, role, date created and date updated