Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Search results

  1. S

    DS with R | Sept 2 - Sept18 | Nimisha

    # Rock Paper Scissor : # 2. Continue untill its a draw name <- vector() for (i in c(1,2)) { name <- c(name,readline(paste('enter player ',i,' name. '))) } flag <- 0 while(flag==0) { choice <- vector() for (j in c(1,2)) { choice <- c(choice,tolower(readline(paste('enter player ',j,'...
  2. S

    DS with R | Sept 2 - Sept18 | Nimisha

    # Rock Paper Scissor : # 1. Best 3 out of 5 name <- vector() winner <-vector() for (i in c(1,2)) { name <- c(name,readline(paste('enter player ',i,' name. '))) } while(length(winner)!=5) { choice <- vector() for (j in c(1,2)) { choice <- c(choice,tolower(readline(paste('enter player...
  3. S

    DS with R | Sept 2 - Sept18 | Nimisha

    #### prime numbers between 2000 and 3000 #### n <- c(2000:3000) prime_no <- vector() prime <- function(num){ flag <- 0 for (i in c(2: (num/8))) { if(num%%i == 0){ flag = 1 break } } if(flag == 0){ return(num) } } for (i in n) { prime_no <-c(prime_no,prime(i)) }...
  4. S

    DS with R | Sept 2 - Sept18 | Nimisha

    ### Rock, Scissor, Paper Game ### name <- vector() choice <- vector() for (i in c(1,2)) { name <- c(name,readline('enter your name')) choice <- c(choice,tolower(readline('enter "r" for rock, "p" for paper or "s" for scissor.'))) } if((choice[1]=='r' & choice[2]=='s') | (choice[1]=='p' &...
Top