Skip to content

Instantly share code, notes, and snippets.

@Ram-N
Created February 23, 2013 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ram-N/5019092 to your computer and use it in GitHub Desktop.
Save Ram-N/5019092 to your computer and use it in GitHub Desktop.
# w-cols to the R and L of center column
seedColumns <- function(c, w){
startLCol = as.integer( (areaW-c) / 2 )
startRCol = as.integer( (areaW+c) / 2 )
for(y in 1:areaH) {
clist = c((startLCol-w):startLCol, startRCol:(startRCol+w))
lapply(clist, function(x) area_df[x,y] <<- 1)
}
}
#seed two vertical columns of width w
seedColumns(12,2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment