Created
June 12, 2014 13:49
-
-
Save Nickstr/0f2e728b0a4a3020c816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Input: 1 2 2 5 | |
// Issue; println(pair), line 12, is not being printed in the console | |
def setupNormalRegions(regions: String) { | |
// Remove spaces from input | |
val groupedRegions: String = regions.replaceAll(" ", ""); | |
// Group regions by 2 numbers (id, value) and loop over them | |
groupedRegions.grouped(2).map { pair => | |
// Trying to get pair here for testing | |
println(pair) | |
// Create id and Value | |
val id :: value :: Nil = pair.toList | |
// Create new Region object | |
val region = new NormalRegion(id.toInt, value.toInt) | |
// Add Region to map | |
map.addRegion(region); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment