Create a two-player tic-tac-toe game in Ruby.
- Must define at least two classes
- Must define at least one exception class
- Must use at least one
Array
- Must use at least one
Hash
# API v1.1, HTTPS | |
# Expected: {\"errors\":[{\"message\":\"Bad Authentication data\",\"code\":215}]} | |
# Raises: EOFError: end of file reached | |
require 'net/http' | |
uri = "https://api.twitter.com/1.1/users/show.json?user_id=33978" | |
Net::HTTP.get(URI(uri)) | |
# API v1, HTTPS | |
# Expected: {\"errors\":[{\"message\":\"Bad Authentication data\",\"code\":215}]} | |
# Raises: EOFError: end of file reached |
class Menu | |
attr_reader :first, :last | |
def initialize | |
@first, @last = 2.times.collect{|i| prompt(i + 1)} | |
end | |
def prompt(number) | |
print "Enter number #{number}:\t" | |
gets.chomp.to_i |
This week, Hewlett-Packard (where I am on the board) announced that it is exploring jettisoning its struggling PC business in favor of investing more heavily in software, where it sees better potential for growth. Meanwhile, Google plans to buy up the cellphone handset maker Motorola Mobility. Both moves surprised the tech world. But both moves are also in line with a trend I've observed, one that makes me optimistic about the future growth of the American and world economies, despite the recent turmoil in the stock market.
In short, software is eating the world.
class RomanNumeralGenerator | |
TABLE = { | |
1000 => "M", | |
900 => "CM", | |
500 => "D", | |
400 => "CD", | |
100 => "C", | |
90 => "XC", | |
50 => "L", | |
40 => "XL", |
/products
route that lists all the products in the store database in an HTML table/
) that contains links to the /users
and /products
pages/users
and /products
that takes you back to the home pageYou will be creating a movies app using Sinatra and the OMDB API.