soc-181-s2021 / weighted-dice-Jaaca-

0 stars 0 forks source link

Some feedback #1

Open elinw opened 3 years ago

elinw commented 3 years ago

https://github.com/soc-181-s2021/weighted-dice-Jaaca-/blob/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6/index.html#L48

This is looking good! :-) What you want to do next is add the bones argument so that you don't always have to have a six sided die. (So bones replaces the 1:6 and then you would have the argument bones inside the function(). @jat9102

elinw commented 3 years ago

So what you want to have here is

roll <- function(bones = 1:6)

So that you can change the number of sides of the dice.

jat9102 commented 3 years ago

Hi Professor, that's also in my project, I don't know why you're not seeing it.


From: elinw notifications@github.com Sent: Sunday, February 21, 2021 7:32 PM To: soc-181-s2021/weighted-dice-Jaaca- weighted-dice-Jaaca-@noreply.github.com Cc: jaaca.thomas jaaca.thomas@lc.cuny.edu; Mention mention@noreply.github.com Subject: Re: [soc-181-s2021/weighted-dice-Jaaca-] Some feedback (#1)

So what you want to have here is

roll <- function(bones = 1:6)

So that you can change the number of sides of the dice.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/issues/1#issuecomment-783051508, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASU4TDT5VDB7LZDKBZHOIGDTAHF4PANCNFSM4X6JJHYA.

jat9102 commented 3 years ago

Search or jump to… [https://github.githubassets.com/images/search-key-slash.svg] Pull requestshttps://github.com/pullsIssueshttps://github.com/issues Marketplacehttps://github.com/marketplace Explorehttps://github.com/explore https://github.com/notifications

[@jat9102] Learn Git and GitHub without any code!

Using the Hello World guide, you’ll start a branch, write comments, and open a pull request.

Read the guidehttps://guides.github.com/activities/hello-world/ soc-181-s2021https://github.com/soc-181-s2021/weighted-dice-Jaaca-https://github.com/soc-181-s2021/weighted-dice-Jaaca-

} roll()

Now you can make a second roll function in which you change the name die to bones,

roll2 <- function(bones = 1:6) { dice <- sample(bones, size = 2, replace = TRUE) sum(dice) } roll2(bones = 1:8) roll2(bones =1:12) roll2(bones =1:9)

I am going create a graph of the roll of my dice using the ggplot2 package

install.packages("ggplot2") library("ggplot2")

Now I want to see the result of my 1000 rolls

rolls <- replicate(10000, roll()) qplot(rolls, binwidth = 1)

To add weight to your dice, add a prob argument.

roll <- function() { die <- 1:6 dice <- sample(die, size = 2, replace = TRUE, prob = c(1/8, 1/8, 1/8, 1/8, 1/8, 3/8)) sum(dice) } rolls <- replicate(10000, roll()) qplot(rolls, binwidth = 1)


From: jaaca.thomas jaaca.thomas@lc.cuny.edu Sent: Monday, February 22, 2021 1:07 PM To: soc-181-s2021/weighted-dice-Jaaca- reply@reply.github.com Subject: Re: [soc-181-s2021/weighted-dice-Jaaca-] Some feedback (#1)

Hi Professor, that's also in my project, I don't know why you're not seeing it.


From: elinw notifications@github.com Sent: Sunday, February 21, 2021 7:32 PM To: soc-181-s2021/weighted-dice-Jaaca- weighted-dice-Jaaca-@noreply.github.com Cc: jaaca.thomas jaaca.thomas@lc.cuny.edu; Mention mention@noreply.github.com Subject: Re: [soc-181-s2021/weighted-dice-Jaaca-] Some feedback (#1)

So what you want to have here is

roll <- function(bones = 1:6)

So that you can change the number of sides of the dice.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/issues/1#issuecomment-783051508, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASU4TDT5VDB7LZDKBZHOIGDTAHF4PANCNFSM4X6JJHYA.