Skip to content

Instantly share code, notes, and snippets.

@Ram-N
Last active December 19, 2015 06:49
Show Gist options
  • Save Ram-N/5914365 to your computer and use it in GitHub Desktop.
Save Ram-N/5914365 to your computer and use it in GitHub Desktop.
terminal.cells <- read.csv(problemfile, header=T, stringsAsFactors=FALSE)
terminal.cells$tcell <- (terminal.cells$Y -1)* side + terminal.cells$X # cell serial number
num.colors <- length(unique(terminal.cells$color))
colorpalette <- unique(terminal.cells$palette)
#The problemfile
#X,Y,color, palette
#1,5,1,red
#2,4,1,red
#1,4,2,yellow
#5,5,2,yellow
#1,2,3,blue
#4,4,3,blue
#2,2,4,green
#4,3,4,green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment