Game Instructions

Tap a tile to toggle its color. When a tile changes nearby tiles may change as well. Each move affect multiple tiles. The target is to turn all tiles into yellow in the fewest steps possible.

Press 'j' to show/hide the game. Press 'i' to show/hide the instructions. Press 't' to show/hide the top score table.

Steps: 0

Top Scores

Name Steps
Press J to toggle the game, I to toggle instructions, and T to toggle the top scores

Congratulations!

You solved the puzzle in 0 steps!

Success!

Score submitted successfully!

Error

Failed to submit score. Please try again.

By Name Parameters in Scala PRO

When calling a function and passing over an argument which is an expression that needs to be evaluated, the expression will be evaluated before the function is invoked and its value will be passed over. This is the default behavior. By adding => in between the parameter name and its type we will defer the expression evaluation into the function execution and have it performed when its value is required.

package com.abelski

object Program
{
  def main(args: Array[String])
  {
    println(System.currentTimeMillis())
    printWithDelay(System.currentTimeMillis())
  }

  def printWithDelay( t: => Long) =
  {
    Thread.sleep(10000)
    println(t)
  }
}

The following video clips shows the execution of this code sample, overviews it and explains it.

Share:

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences