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 | |
attr_accessor :rank, :suit | |
def initialize(rank, suit) | |
@rank = rank | |
@suit = suit | |
end | |
def output_card | |
puts "#{self.rank} of #{self.suit}" |
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 | |
attr_accessor :rank, :suit | |
def initialize(rank, suit) | |
@rank = rank | |
@suit = suit | |
end | |
def output_card | |
puts "#{self.rank} of #{self.suit}" |
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 Image | |
def initialize(image) | |
@image = image | |
end | |
def output_image | |
@image.each { |row| puts row.join } | |
#puts blur(row_index, col_index) | |
#transform.each { |row_index, col_index| blur(row_index, col_index) } |
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 Image | |
def initialize(image) | |
@image = image | |
end | |
def output_image | |
@image.each { |row| puts row.join } | |
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 Image | |
def initialize(image) | |
@image = image | |
end | |
#Iterate through @image input and identify which indices have a "1". | |
def identify | |
one_index = [] |
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 LinkedListNode | |
attr_accessor :value, :next_node | |
def initialize(value, next_node=nil) | |
@value = value | |
@next_node = next_node | |
end | |
def print_values(list_node) | |
if list_node |
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 LinkedListNode | |
attr_accessor :value, :next_node | |
def initialize(value, next_node=nil) | |
@value = value | |
@next_node = next_node | |
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
def distance(destination_row, destination_col) | |
if self.vertical?(destination_row, destination_col) | |
return (destination_row - current_row_index).abs | |
elsif self.horizontal?(destination_row, destination_col) | |
return (destination_col - current_column_index).abs | |
elsif self.diagonal?(destination_row, destination_col) | |
return (destination_col - current_column_index).abs | |
# destination_col - current_row_index | |
else | |
puts "Invalid Input" |
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 'rails_helper' | |
RSpec.describe King, type: :model do | |
describe 'valid_move?' do | |
it 'should allow a vertical-up move' do | |
game = FactoryGirl.create(:game) | |
king = King.new(game: game, current_row_index: 5, current_column_index: 5) | |
expect(king.valid_move?(6,5)).to eq true | |
end | |
it 'should allow a vertical-down move' do |
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
/* The Box Model */ | |
.box { | |
background-color: aqua; | |
width: 400px; | |
/* TRBL */ | |
padding: 75px; | |
/* padding-top: 10px; | |
padding-left: 10px; | |
padding-right: 10px; | |
padding-bottom: 10px; */ |
OlderNewer