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.

Concurrency with Isolates in Dart PRO

Dart is a single threaded programming language. Each isolate is a unit of work. It has its own memory allocation. Sharing memory between isolates is not possible. Each isolate can pass over messages to the others. When an isolate receives a message it processes it in a way similar to events handling.

import "dart:isolate";

var product = "noname";

main() 
{
  spawnFunction(sell);
  spawnFunction(buy);
  for(var i=1;i<=10;i++)
  {
    print("market of all goods i=$i product=$product"); 
    for(var m=1;m<=1000000;m++);
  }
  for(var m=1;m<=100000000;m++);
}

sell()
{
  product = "banana";
  for(var i=1;i<=10;i++)
  {
    print("i want to sell $product i=$i");
    for(var m=1;m<=1000000;m++);
  }
}

buy()
{
  product = "tapuz";
  for(var i=1;i<=10;i++)
  {
    print("i want to buy $product i=$i");
    for(var m=1;m<=1000000;m++);
  }
}

The following video clip overviews this code sample, shows its execution 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