Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.53 KB | None | 0 0
  1. object RotationInterpolator extends App {
  2.  
  3.   class Square(lineNumber:Int,rowNumber:Int,boxNumber:Int,possible:List[Int]=List(1,2,3,4),solv:Boolean=false){
  4.     var possibleValue = possible;
  5.     val line = lineNumber;
  6.     val row = rowNumber;
  7.     val box = boxNumber;
  8.     val solved = solv;
  9.    
  10.     def setValue(solution:Int):Square={
  11.      return new Square(line,row,box,List(solution),true)
  12.     }
  13.   }
  14.  
  15.   var s1 = new Square(1,1,1);
  16.  
  17.   s1 =  s1.setValue(3);
  18.   s1.possibleValue.foreach((x:Int)=>println(x));
  19.  
  20.  
  21.  
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement