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
| class BindingExample { | |
| public static void main(String[] args) { | |
| Closure closure1 = { | |
| printit.call("Hello from closure 1") | |
| } | |
| Closure closure2 = { | |
| printit("Hello from closure 2") |
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
| /* | |
| * Determines if a Sudoku board (a list of lists of Cell case classes containing Options for the | |
| * cell value) is filled in incorrectly | |
| */ | |
| def isScrewedUp: Boolean = { | |
| (0 to 8).foldLeft(false) { | |
| (b, i) => b || rowScrewedUp(i) || colScrewedUp(i) || boxScrewedUp(i) | |
| } | |
| } |