R/moveCharLeft.R

Defines functions moveCharLeft

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 Nov. 17, 2017, 5:09 a.m.