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.

Closure in PHP PRO

Closure is a function or a reference for a function together with a table that includes references for each one of the non local variables that exist within the outer scope of the closure. Unlike a plain function pointer the closure can use those non local variables that belong to its outer scope even when invoked out of it.

<?php
class Something
{
	private $number;
	private $person;
	public function __construct($num)
	{
		$this->number = $num;
	}
	public function getFunction()
	{
		return function()
		{
			for($i=1;$i<=$this->number;$i++)
			{
				echo "<br>gaga";
			}
		};
	}
}

$obA = new Something(7);
$obB = new Something(3);
$temp = $obB->getFunction();
$temp();

?>

The following video clip 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