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.

Define Constructor When Using MooTools PRO

When defining a class using the MooTools framework we can include the definition of a constructor inside of it. We just need to add to the object we pass over to Class constructor the ‘initialize’ key with the constructor function as its value.

<!DOCTYPE html>
<html>
<head>
    <title>mootools functions binding demo</title>
    <script type="text/javascript" src="mootools-core-1.4.5-full-compat.js">
    </script>
    <script type="text/javascript">
        var Person = new Class({
            //properties
            name: '',
            id: 0,
            //constructor
            initialize: function(nameVal,idVal)
            {
                this.name = nameVal;
                this.id = idVal;
            },
            //methods
            sleep: function()
            {
                document.write(this.name + ' is sleeping.' + "<br>");
            },
            talk: function()
            {
                document.write(this.name + ' is talking.' + "<br>");
            }
        });
        var a = new Person('david',123123);
        var b = new Person('mike',543543);
        a.talk();
    </script>
</head>
<body>

</body>
</html>

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

Share:

The Beauty of Code

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

Update cookies preferences