Skip to content

Instantly share code, notes, and snippets.

View marinalaguerre20's full-sized avatar

marinalaguerre20

View GitHub Profile
<link rel="stylesheet" type="text/css" href="BC_style.css">
<script src=" signupform.js"></script>
<div class="hometext">
<p>Baby Cycle is the new way to shop for your babyBaby Cycle is the new way to shop for your babyBaby Cycle is the new way to shop for your babyBaby Cycle</p>
</div>
<div class="lightbox">
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
puts "Please enter your word."
class Scrabble
attr_reader :word
def points
{
"A"=>1, "B"=>3, "C"=>3, "D"=>2,
"E"=>1, "F"=>4, "G"=>2, "H"=>4,
"I"=>1, "J"=>8, "K"=>5, "L"=>1,
"M"=>3, "N"=>1, "O"=>1, "P"=>3,
"Q"=>10, "R"=>1, "S"=>1, "T"=>1,
puts "please enter some text"
class Frequency_count
def count_words
@text = gets.chomp
@words = @text.split(' ')
@frequency = Hash.new(0)
@words.each { |word| @frequency[word.downcase] += 1 }
return @frequency
# # create a function that takes the string and adds the phrase
# "only in America!" to the end of it.
puts "Exercise 1: Please enter you phrase"
phrase = gets.chomp
def add(phrase)
phrase + " only in America"
end
puts add(phrase)
# # create a function that takes the string and adds the phrase
# "only in America!" to the end of it.
puts "Exercise 1: Please enter you phrase"
phrase = gets.chomp
def add(phrase)
phrase + " only in America"
end
puts add(phrase)
# Create a program that takes a word and provides a Scrabble score associated with that word.
def score(word)
letter = word.split("")
puts ("your word will be played in the letters#{letter}")
chart = points({
"A"=>1, "B"=>3, "C"=>3, "D"=>2,
"E"=>1, "F"=>4, "G"=>2, "H"=>4,