Skip to content

Instantly share code, notes, and snippets.

View rodhilton's full-sized avatar

Rod Hilton rodhilton

View GitHub Profile
@rodhilton
rodhilton / gist:5138266
Last active December 14, 2015 19:39
Some weirdness with groovy binding
class BindingExample {
public static void main(String[] args) {
Closure closure1 = {
printit.call("Hello from closure 1")
}
Closure closure2 = {
printit("Hello from closure 2")
/*
* 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)
}
}