Assignment 5 - 1d

Assignment 5 - 1d

by Lauren Fleshner -
Number of replies: 1

Hi, 

I am having trouble calling a function within a function for 1d. Since we want the proportion to show in 1d and not in the single play.monty.hall function (that wants us to spit out just win/lose) once I call the play.monty.hall function and then code for it to spit out the proportions, it keeps saying ____ not found. I think this is because I defined these variables in the play.monty.hall function not in this one. How do we code to spit out the proportions then if we can't use the variables defined earlier? If I define the variables used in play.many.monty.halls then I am essentially recoding the play.monty.hall function and then it is unnecessary to call on it. 

Any advice is appreciated!

Thank you!

Lauren

In reply to Lauren Fleshner

Re: Assignment 5 - 1d

by Erik Spence -
The play.monty.hall function returns a boolean, and takes a boolean as an argument. It represents one play of the game. The play.many.monty.halls should not need to reference any variables from within the play.monty.hall function. I'm not sure why you would need to. Without seeing your code I'm not sure what the problem is.