Assignment 5 part 2

Assignment 5 part 2

by Nahla FadlElMawla -
Number of replies: 4
do we need to have a function in Run.monty.hall file 
because when I do function() {
 if ( args == keep) .... it doesn't work but when I do if right away it work
is that a problem in my utilities file? 

Also when I am trying to put in the conditions for else if it acts as if I did else only so it just does car( error message) whatever the argument is
 
In reply to Nahla FadlElMawla

Re: Assignment 5 part 2

by Erik Spence -
Do you have a variable defined called 'keep'? I suspect not. Is it a variable called 'keep' you want to be comparing the argument to, or something else (though similar)?
In reply to Erik Spence

Re: Assignment 5 part 2

by Nahla FadlElMawla -
I don't have a variable called keep I am using this if (args[1] == "Keep")
play.monty.halls(100,FALSE)

I tried to make a vector that has c("Keep", "Switch") but it does the same thing works for keep and switch but then gives off the same error message I gave it for any other thing
In reply to Nahla FadlElMawla

Re: Assignment 5 part 2

by Erik Spence -
Without seeing your code I can't say what the problem is.
In reply to Nahla FadlElMawla

Re: Assignment 5 part 2

by Edgardo Torres -
Is that a copy and paste of your code? Because keep without quotation marks is referencing a variable. “Keep” with quotation marks references the word keep