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
// index.html | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Guess the Number</title> | |
</head> | |
<body> | |
<script src="guess_the_number.js"></script> |
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
class Card | |
def initialize(rank, suit) | |
@suit = suit | |
@rank = rank | |
end | |
def suit | |
@suit | |
end |
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
class Car | |
def initialize(color, owner, cylinders) | |
@color = color | |
@owner = owner | |
@cylinders = cylinders | |
end | |
def color | |
@color | |
end |
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
class Television | |
def initialize(size, type) | |
@size = size | |
@type = type | |
end | |
end | |
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
class Card | |
def initialize(rank = nil, suit = nil) | |
if suit.nil? && rank .nil? | |
@suit = ['♠', '♣', '♥', '♦'].sample | |
else | |
@suit = suit | |
end | |
@rank = rank | |
puts "Create a new card: #{@rank} of #{@suit}" | |
end |
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
require 'pry' | |
RANK = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'] | |
SUIT = ['♠', '♥', '♣', '♦'] | |
class Card | |
attr_reader :card | |
#represent an individual playing card. This class should | |
#contain the suit and the value and provide methods for |
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
require 'pry' | |
class Mortgage | |
attr_reader :home_value, :down_payment_percentage, :apr, :duration_in_years | |
def initialize(home_value, down_payment_percentage, apr, duration_in_years) | |
@home_value = home_value | |
@down_payment_percentage = down_payment_percentage | |
@apr = apr | |
@duration_in_years = duration_in_years |
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
#1 | |
SELECT title, rating FROM movies ORDER BY rating ASC LIMIT 50; | |
#2 | |
SELECT title FROM movies WHERE rating IS NULL ORDER BY title; | |
#3 | |
SELECT title FROM movies WHERE synopsis LIKE '%thrilling%'; | |
#4 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Kickball Teams</title> | |
<link rel="stylesheet" href="home.css" /> | |
</head> | |
<body> | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Kickball Teams</title> | |
<link rel="stylesheet" href="home.css" /> | |
</head> | |
<body> | |
<h1>Kickball Teams</h1> |
NewerOlder