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 Sudoku | |
def initialize board | |
@board = board | |
end | |
def solve! | |
num_index = @board.index('0') | |
return true unless num_index | |
('1'..'9').each do |possibility| | |
@board[num_index] = possibility |
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 'artoo' | |
connection :arduino, adaptor: :firmata, port: '/dev/cu.usbmodem1421' # linux | |
device :board, :driver => :device_info | |
device :serv, :driver => :servo, :pin => 5 # pin must be a PWM pin | |
work do | |
puts "Firmware name: #{board.firmware_name}" | |
puts "Firmata version: #{board.version}" |
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
850002400720000009004000000000107002305000900040000000000080070017000000000036040 | |
005300000800000020070010500400005300010070006003200080060500009004000030000009700 | |
120040000005069010009000500000000070700052090030000002090600050400900801003000904 | |
000570030100000020700023400000080004007004000490000605042000300000700900001800000 | |
700152300000000920000300000100004708000000060000000000009000506040907000800006010 | |
100007090030020008009600500005300900010080002600004000300000010040000007007000300 | |
100034080000800500004060021018000000300102006000000810520070900006009000090640002 | |
000920000006803000190070006230040100001000700008030029700080091000507200000064000 | |
060504030100090008000000000900050006040602070700040005000000000400080001050203040 | |
700000400020070080003008079900500300060020090001097006000300900030040060009001035 |
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
#left-column { | |
height: 600px; | |
width: 48%; | |
float: left; | |
margin: 16px 1% 0 2%; | |
background-color: blue; | |
} | |
#center-nav, #right-column { | |
height: 600px; |
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 'snoo' | |
require 'json' | |
config = { | |
export_file_name: 'comments_for_ginger', | |
subreddit: 'askreddit' | |
} | |
class RedditParser | |
attr_accessor :subreddit |
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> | |
<head> | |
<title>DOM manipulation with jQuery</title> | |
<!-- Add a link to jQuery CDN here script here --> | |
<script type="text/javascript" src="jquery_example.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
class BoggleBoard | |
attr_reader :num_rows, :num_cols | |
def initialize(board) | |
@board = board | |
@num_rows = @board.count | |
@num_cols = @board[0].count | |
end | |
def create_word(*coords) |
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 BoggleBoard | |
#your code here | |
end | |
dice_grid = [["b", "r", "a", "e"], | |
["i", "o", "d", "t"], | |
["e", "c", "l", "r"], |
NewerOlder