Hi,
I changed to code of the match 3 template to also allow a suggestion by pressing the "S" button in the interface. It holds a rather easy solution by checking if the top left and bottom let or top right and bottom right jewel are the same of the center jewel.
A function with a pretty straight forward logic you can easily adapt.
The guys at scirra just approved the version on the store. Feel free to pick it up if you still need it. I copied the code of the function below in case you're interested
cheers!
* On function 'CheckSuggestion'
| Local number suggestionfound = 0
| Local number curcol = 0
| Local number currow = 0
| Local string curtype =
| Local string typeTL =
| Local string typeTR =
| Local string typeBR =
| Local string typeBL =
----+ (no conditions)
-----> suggestion: Clear
----+ System: For "columnloop" from 0 to NUM_COLS-1
--------+ System: For "rowloop" from 0 to NUM_ROWS-1
// once a suggestion is found, stop searching for it
------------+ System: suggestionfound = 0
----------------+ (no conditions)
-----------------> System: Set curcol to LoopIndex("columnloop")
-----------------> System: Set currow to LoopIndex("rowloop")
-----------------> System: Set curtype to Functions.GetJewelTypeForCoordinate( currow, curcol )
-----------------> System: Set typeBL to Functions.GetJewelTypeForCoordinate( currow+1, curcol-1 )
-----------------> System: Set typeBR to Functions.GetJewelTypeForCoordinate( currow+1, curcol+1 )
-----------------> System: Set typeTL to Functions.GetJewelTypeForCoordinate( currow-1, curcol-1 )
-----------------> System: Set typeTR to Functions.GetJewelTypeForCoordinate( currow-1, curcol+1 )
// powerups don't count for suggestions
--------------------+ System: curtype ≠ "cross_powerup"
------------------------+ System: curtype = typeTL
------------------------+ System: curtype = typeBL
-------------------------> System: Set suggestionfound to 1
// add jewels to dictionary for highlighting
----------------------------+ System: Pick jewels by evaluating jewels.row = currow & jewels.column = curcol
-----------------------------> suggestion: Add key str(jewels.UID) with value 0
----------------------------+ System: Pick jewels by evaluating jewels.row = currow-1 & jewels.column = curcol-1
-----------------------------> suggestion: Add key str(jewels.UID) with value 0
----------------------------+ System: Pick jewels by evaluating jewels.row = currow+1 & jewels.column = curcol-1
-----------------------------> suggestion: Add key str(jewels.UID) with value 0
------------------------+ System: curtype = typeTR
------------------------+ System: curtype = typeBR
-------------------------> System: Set suggestionfound to 1
----------------------------+ System: Pick jewels by evaluating jewels.row = currow & jewels.column = curcol
-----------------------------> suggestion: Add key str(jewels.UID) with value 0
----------------------------+ System: Pick jewels by evaluating jewels.row = currow-1 & jewels.column = curcol+1
-----------------------------> suggestion: Add key str(jewels.UID) with value 0
----------------------------+ System: Pick jewels by evaluating jewels.row = currow+1 & jewels.column = curcol+1
-----------------------------> suggestion: Add key str(jewels.UID) with value 0
// Possible extension : also check TR + TL or BL + BR
------------------------+ (no conditions)
-------------------------> (no actions)
// Finally also return the number of values in the explode dictionary, so expressions that call this function can check if there are any matches in the entire grid
----+ (no conditions)
-----> Functions: Set return value suggestion.KeyCount