Skip to content

Instantly share code, notes, and snippets.

View micodel's full-sized avatar

Michael Hamel micodel

View GitHub Profile
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title> DBC Medical Exam </title>
</head>
@micodel
micodel / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:55 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
# INITIAL CODE:
# -------------
class Boggle
def initialize(dice_grid)
@board = dice_grid
end
@micodel
micodel / gist:8301867
Created January 7, 2014 16:23
Print a right triangle: syntax question.
=begin
Hey, thanks for taking the time to help.
I was under the impression that a defined method could see variables outside of the method.
My original attempt to solve this problem was (example 1), where the variable star = "*" was defined outside the method.
I understand that having a method variable defined in the method is more practical for reusing the method.
But I was curious why it wouldnt work.
def mean(array)
sum = 0
array.each do |x|
sum += x
end
mean = sum / array.length