This file contains hidden or 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
#TO DO: import puzzle file, puzzle generator, solutions view omitting unused characters, solutions view highlighting selected words, verbose options, test multiple solutions | |
samplepuzzle = [ ['b', 'b', 'c', 'd', 'e'], | |
['f', 'e', 'g', 'g', 'j'], | |
['k', 'a', 'l', 'o', 'o'], | |
['s', 'r', 's', 'l', 's'], | |
['u', 's', 'w', 'd', 'y']] | |
samplebank = [%w{b e a r s}, %w{e g g}, %w{g o l d}, %w{b e l l}] |
This file contains hidden or 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
x = [1,2] | |
y = x | |
y[0] = 2 | |
print x; print y #=> [2,2][2,2] |
This file contains hidden or 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
example = [ ['a', 'b', 'c', 'd', 'e'], | |
['f', 'g', 'h', 'i', 'j'], | |
['k', 'l', 'm', 'n', 'o'], | |
['p', 'q', 'r', 's', 't'], | |
['u', 'v', 'w', 'x', 'y']] | |
$letterhash = Hash.new | |
('a'..'z').each do |letter| | |
row = 0 |
This file contains hidden or 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
Shoes.app :margin => 20, :width => 360 do | |
flow :width => 1.0, :height => 30 do | |
background gray(0.5) | |
stack :width => 0.5 do | |
para strong "Magic Tool", :size => 14 | |
end | |
stack :width => 0.25 | |
stack :width => 0.25 do | |
flow do | |
button("+") {} |
This file contains hidden or 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
# TO DO: fix difficulty | |
columns = Array.new | |
# rows inside columns ; (y, x) | |
def createmap(mcolumns) #sticks rows in columns | |
asdf = 0 | |
while asdf < $boardy | |
rows = Array.new($boardx) {'.'} | |
mcolumns.push(rows) | |
asdf += 1 |
This file contains hidden or 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
filename = ARGV.first | |
text = '' | |
text = File::open(filename) | |
readit = text.read | |
contents = readit.downcase.split(/\n+/) |
This file contains hidden or 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 String | |
def findchar(n) | |
self[n,1] #gets nth character | |
end | |
end | |
example = ['banana', 'elephant', 'apple', 'friday', 'cocaine', 'damage'] | |
array = example | |
parray = Array.new |
This file contains hidden or 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
puts "Welcome to Super Tic-Tac-Toe. I wear shiny spandex." | |
#---opp CHOOSER | |
teamrand = rand(0..1) | |
if teamrand == 0 | |
team = 'x' | |
opp = 'o' | |
puts "You're x, you go first." | |
elsif teamrand == 1 | |
team = 'o' |
This file contains hidden or 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 String | |
def initial | |
self[0,1] #gets first character | |
end | |
def twoinitial | |
self[0,2] #gets first two characters | |
end | |
def secondy | |
self[1,1] | |
end |
This file contains hidden or 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 prompt() | |
print "-> " | |
end | |
class Medical | |
def bed() | |
puts "You awake to the sound of alarms and flames. You're lying on a bed 3 meters from a raging fire. What do you do?" |