Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fizzbuzz.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,16 @@ for(i in 1:100){
}
print(answer)
```
###Angelina Vasquez Code
```{r}
for(i in 1:100)
if(i%%3==0){
print("Fizz")}
if(i%%5==0){
print( "Buzz" )
}else(i%%3==0 && i%%5==0)
print( "FizzBuzz" )

#It did not work the way it was supposed to
```

46 changes: 46 additions & 0 deletions fizzbuzz.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,52 @@ <h3>Matt’s Code</h3>
}
print(answer)</code></pre>
</div>
<div id="angelina-vasquez-code" class="section level3">
<h3>Angelina Vasquez Code</h3>
<pre class="r"><code>for(i in 1:100)
if(i%%3==0){
print(&quot;Fizz&quot;)}</code></pre>
<pre><code>## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;
## [1] &quot;Fizz&quot;</code></pre>
<pre class="r"><code> if(i%%5==0){
print( &quot;Buzz&quot; )
}else(i%%3==0 &amp;&amp; i%%5==0)</code></pre>
<pre><code>## [1] &quot;Buzz&quot;</code></pre>
<pre class="r"><code> print( &quot;FizzBuzz&quot; )</code></pre>
<pre><code>## [1] &quot;FizzBuzz&quot;</code></pre>
<pre class="r"><code> #It did not work the way it was supposed to</code></pre>
</div>



Expand Down
16 changes: 16 additions & 0 deletions snakesladders.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,20 @@ for (i in 1:1000) {
avg_moves <- mean(count)
print(avg_moves)
```
###Angelina Vasquez Code
```{r}
save_rolls <- c()
for(sims in 1:1000){
total_sum<-0
number_of_rolls<-0
while(total_sum < 25){
number_of_rolls <- number_of_rolls+1
total_sum <-total_sum+sample(c(1,2,3,4,5,6),1)
}
save_rolls[sims] <- number_of_rolls
}
mean(save_rolls)

#Just used the code you had in the example. Couldn't come up with a solution
```

18 changes: 17 additions & 1 deletion snakesladders.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,23 @@ <h3>Jeff Kravitz</h3>
}
avg_moves &lt;- mean(count)
print(avg_moves)</code></pre>
<pre><code>## [1] 8.792</code></pre>
<pre><code>## [1] 8.766</code></pre>
</div>
<div id="angelina-vasquez-code" class="section level3">
<h3>Angelina Vasquez Code</h3>
<pre class="r"><code>save_rolls &lt;- c()
for(sims in 1:1000){
total_sum&lt;-0
number_of_rolls&lt;-0
while(total_sum &lt; 25){
number_of_rolls &lt;- number_of_rolls+1
total_sum &lt;-total_sum+sample(c(1,2,3,4,5,6),1)
}
save_rolls[sims] &lt;- number_of_rolls
}
mean(save_rolls)</code></pre>
<pre><code>## [1] 7.626</code></pre>
<pre class="r"><code>#Just used the code you had in the example. Couldn't come up with a solution</code></pre>
</div>


Expand Down