Open elinw opened 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.
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.
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-
Watch 1https://github.com/soc-181-s2021/weighted-dice-Jaaca-/watchers
Star0https://github.com/soc-181-s2021/weighted-dice-Jaaca-/stargazers
Fork 0https://github.com/soc-181-s2021/weighted-dice-Jaaca-/network/members
Issues1https://github.com/soc-181-s2021/weighted-dice-Jaaca-/issues
Pull requestshttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/pulls
Actionshttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/actions
Projectshttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/projects
Wikihttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/wiki
Securityhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/security
Insightshttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/pulse
Settingshttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/settings
11ea23df8a weighted-dice-Jaaca-https://github.com/soc-181-s2021/weighted-dice-Jaaca-/tree/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6/index.html Go to filehttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/find/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6 [@jat9102]https://github.com/jat9102 jat9102https://github.com/jat9102 Create index.htmlhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/commit/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6 Latest commit 11ea23dhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/commit/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6 2 days ago Historyhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/commits/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6/index.html 1 contributor 57 lines (40 sloc) 1.36 KB Rawhttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/raw/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6/index.htmlBlamehttps://github.com/soc-181-s2021/weighted-dice-Jaaca-/blame/11ea23df8a4699ba0b98565bdeaf1bda379f5ad6/index.html#L48 https://github.com/login?return_to=%2Fsoc-181-s2021%2Fweighted-dice-Jaaca-%2Fblob%2F11ea23df8a4699ba0b98565bdeaf1bda379f5ad6%2Findex.html https://github.com/login?return_to=%2Fsoc-181-s2021%2Fweighted-dice-Jaaca-%2Fblob%2F11ea23df8a4699ba0b98565bdeaf1bda379f5ad6%2Findex.html
die <-c(1:6)
sample (die,size=2) sample(die, size=2, replace =TRUE)
dice2 <- sample(die, size=2, replace=TRUE) dice2 sum(dice2)
roll <- function() { die <- 1:6 dice <- sample(die, size = 2, replace = TRUE) sum(dice)
} roll()
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)
install.packages("ggplot2") library("ggplot2")
rolls <- replicate(10000, roll()) qplot(rolls, binwidth = 1)
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.
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