##Floats Floats allow elements to flow naturally within the a page in relation to each other.
######Example In the example below, the three box elements will float on a single row withing the parent div
.box {
float: left;
width: 30%;
}
t |
def inc_mean arr | |
current_sum = 0 | |
arr.map!.with_index do |val, index| | |
current_sum += val | |
current_sum.to_f / (index + 1) | |
end | |
return arr | |
end | |
arr = [10, 10, 15, 15, 20] |
##Floats Floats allow elements to flow naturally within the a page in relation to each other.
######Example In the example below, the three box elements will float on a single row withing the parent div
.box {
float: left;
width: 30%;
}
######REFLECTION This challenge was pretty cool. Jquery seems pretty sweet, and it's nice that it conatins a bunch of prepaackaged stuff that works across browsers. I do have a question though - when is it appropriate to use jquery over plain javascript?
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<link rel="stylesheet" type="text/css" href="css/normalize.css" media="screen"> | |
<link rel="stylesheet" type="text/css" href="css/style.css"> | |
<meta name="viewport" content="width=device-width, initial-scale = 1.0, user-scalable = no"> | |
<title>MapWich</title> | |
<script type="text/javascript" |
class BoggleBoard | |
#your code here | |
def initialize(dice_grid) | |
@dice_grid = dice_grid | |
end | |
def create_word(*coords) | |
coords.map { |coord| @dice_grid[coord.first][coord.last] }.join | |
end |