R/moveCharLeft.R

moveCharLeft<-function(vettore, verbose){
  
  if(verbose==1){
    print(paste(vettore, "################"))
  }
  
  spia<-NA
  
  for(j in 1:(length(vettore)-1)){
    
    for(i in 1:(length(vettore)-1))
      if(vettore[i]=="*"){
        spia<-vettore[i+1]
        vettore[i+1]<-"*"
        vettore[i]<-spia
      }
    
  }
  
  vettore
}

Try the PdPDB package in your browser

Any scripts or data that you put into this service are public.

PdPDB documentation built on May 2, 2019, 2:09 a.m.