Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def printSolution(): Unit ={
- val str:String = ""
- var s1:String = ""
- var s2:String = ""
- var s3:String = ""
- var s4:String = ""
- val sX:String = "x"
- val space:String = " "
- for(y<-allSquares.indices.toList){
- for(x<-allSquares.indices.toList){
- //Print the values
- print(allSquares(x)(y).possibleValues.mkString(","))
- //Print right neighbor or not
- if (allSquares(x)(y).neighbors.contains(Direction.right)){
- print("x")
- }
- else {
- print(" ")
- }
- } // for(x)
- //Remove some code and added this
- //This will work on all sizes if i am not mistaken
- //and also follow functional requirments
- // You jobb double check it, understand it, write comments and clean up the code
- print("\n")
- for (v<-(0 until num).toList){
- if (allSquares(v)(y).neighbors.contains(Direction.down)){
- print("x ")
- }
- else{
- print(" ")
- }
- }
- //Above
- println("");
- } // for(y)
- } // printSolution()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement