This file contains hidden or 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
import _root_.scala.util.Random | |
def lifeGameIterator(stride:Int) = new Iterator[Array[Array[Boolean]]] { | |
private def pathFilter(num : Int) = num | |
private def prevFilter(num : Int) = if(num == 0) stride - 1 else num - 1 | |
private def nextFilter(num : Int) = if(num == stride - 1) 0 else num + 1 | |
private def cellArriveGetter(xFilter:(Int)=>Int, yFilter: (Int)=>Int) | |
(cells:Array[Array[Boolean]], x:Int, y:Int) = cells(yFilter(y))(xFilter(x)) | |
private val _isArriveGetter = List( |
This file contains hidden or 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
(define panel #(5 3 0 0 7 0 0 0 0 | |
6 0 0 1 9 5 0 0 0 | |
0 9 8 0 0 0 0 6 0 | |
8 0 0 0 6 0 0 0 3 | |
4 0 0 8 0 3 0 0 1 | |
7 0 0 0 2 0 0 0 6 | |
0 6 0 0 0 0 2 8 0 | |
0 0 0 4 1 9 0 0 5 |
NewerOlder