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 Node | |
attr_reader :value, :left, :right | |
def initialize(value, left, right) | |
@value, @left, @right = value, left, right | |
end | |
end | |
class CountObject | |
attr_reader :char, :value |
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>Minimum html page.</title> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="index.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
</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
# Start server from command line with 'rackup hello_rack_app.rb' | |
# Make a GET request to the localhost port with cURL or your browser | |
require 'rack' | |
class Hello | |
def self.call(env) | |
[ | |
'200', | |
{ 'Content-type' => 'text/html' }, |
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 'csv' | |
friends = [] | |
File.open("hamburgler.txt", 'r') do |f| | |
f.each_line { |line| friends << line.chomp } | |
end | |
p friends | |
File.open("helicopter.txt", 'w') do |f| | |
friends.each do |item| |
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 checker(board, word, last_idx = nil) | |
return true if word.empty? | |
#take letter from front of word | |
letter = word.slice!(0) | |
this_idx = [] | |
# change last letter to "NO" | |
if last_idx | |
board[last_idx[:row]][last_idx[:column]] = "NO" |