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
2 changes: 2 additions & 0 deletions 7709Rproblems.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

BuildType: Website
45 changes: 26 additions & 19 deletions fizzbuzz.Rmd
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
---
title: "Fizzbuzz"
author: "Matt"
date: "2/12/2019"
title: "FizzBuzz"
author: "Richard Troise"
date: "2/25/2019"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

This document contains student solutions to the fizzbuzz problem. Students will add to this file using the outline below. Write your name (using three hashtags), then below create an R code block and insert your code. Save the .rmd file, then knit the document to update the html output. Then submit a pull request to merge your changes to the main repository.
```{r, eval = FALSE}
vec_num <- c(1:100)

### Student Name
k <- 1
while(k <= 100) {
if(vec_num[k]%%3==0 || vec_num[k]%%5==0) {
if(vec_num[k]%%3==0 && vec_num[k]%%5== 0) {
print("FizzBuzz")
k <- k + 1
}
else if(vec_num[k]%%5 == 0) {
print("Buzz")
k <- k + 1
}
else {
print("Fizz")
k <- k + 1
}
}

else {
print(vec_num[k])
k <- k + 1
}

```{r}
#your code here
1+1
```

### Matt's Code

```{r,eval=F}
answer <- 1:100
for(i in 1:100){
if(i%%3 == 0) answer[i] <-"fizz"
if(i%%5 == 0) answer[i] <-"buzz"
if(i%%5 == 0 & i%%3 ==0) answer[i] <-"fizzbuzz"
}
print(answer)
```

253 changes: 38 additions & 215 deletions fizzbuzz.html

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions snakesladders.Rmd
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
title: "Snakes and Ladders"
author: "Matt"
date: "2/12/2019"
author: "Richard Troise"
date: "2/24/2019"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

This document contains student solutions to the snakes and ladders problem. Students will add to this file using the outline below. Write your name (using three hashtags), then below create an R code block and insert your code. Save the .rmd file, then knit the document to update the html output. Then submit a pull request to merge your changes to the main repository.

### Student Name
### Richard Troise

```{r}
#your code here
# working on it
```

214 changes: 14 additions & 200 deletions snakesladders.html

Large diffs are not rendered by default.