Here is our beta version (no multi-location playing yet) of Tic-Tac-Toe
if anyone wants to take a look.
[{"id":"e1fd8135.0c3c98","type":"subflow","name":"Subflow 1","info":"","category":"","in":[{"x":80,"y":60,"wires":[{"id":"dfb183f3.faeb4"}]}],"out":[{"x":460,"y":320,"wires":[{"id":"10e682f6.b25e1d","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"b24572c.f46531","type":"change","z":"e1fd8135.0c3c98","name":"mi-clear","rules":[{"t":"set","p":"player","pt":"global","to":"2","tot":"num"},{"t":"set","p":"ui_control","pt":"msg","to":"{\"icon\":\"mi-clear\",\"bgcolor\":\"#FF4444\"}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":100,"wires":[["94219e5b.949e7"]]},{"id":"f983ea23.268478","type":"switch","z":"e1fd8135.0c3c98","name":"Player 1 or 2","property":"player","propertyType":"global","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":120,"wires":[["b24572c.f46531"],["f5db7ec0.bab29"]]},{"id":"f5db7ec0.bab29","type":"change","z":"e1fd8135.0c3c98","name":"mi-clear","rules":[{"t":"set","p":"player","pt":"global","to":"1","tot":"num"},{"t":"set","p":"ui_control","pt":"msg","to":"{ \"icon\":\"mi-lens\" }","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":140,"wires":[["94219e5b.949e7"]]},{"id":"10e682f6.b25e1d","type":"function","z":"e1fd8135.0c3c98","name":"Check for Winner","func":"// b [r][c] r=row c= column\n\nmsg.payload = \"no winner yet\"\nvar b = global.get(\"board\")\n\n//node.warn(\"b = \"+b)\n//node.warn(\"b[0][0] = \"+b[0][0])\n//node.warn(\"b[0][1] = \"+b[0][1])\n//node.warn(\"b[0][2] = \"+b[0][2])\nvar tt =b[0][0] + b[0][1] + b[0][2]\n//node.warn(\"tt = \"+tt)\n// ----------------------------------------------------------\n// check to see if all squares used - draw unless someone won\nvar t = 0\nfor (r=0; r<3; r++){\n for (c=0; c<3; c++){\n t += b[r][c]\n }\n}\n//node.warn(\"total = \"+t)\nif (t == 13) msg.payload = \"It's a draw\"\n\n// ----------------------------------------------------------\n// Check to see if X wins \n// Check row 1 - 3\nif ((b[0][0] + b[0][1] + b[0][2]) == 3) msg.payload = \"X wins\"\nif ((b[1][0] + b[1][1] + b[1][2]) == 3) msg.payload = \"X wins\"\nif ((b[2][0] + b[2][1] + b[2][2]) == 3) msg.payload = \"X wins\"\n\n// Check column 1 - 3\nif ((b[0][0] + b[1][0] + b[2][0]) == 3) msg.payload = \"X wins\"\nif ((b[0][1] + b[1][1] + b[2][1]) == 3) msg.payload = \"X wins\"\nif ((b[0][2] + b[1][2] + b[2][2]) == 3) msg.payload = \"X wins\"\n\n// Check DIAGONALS\nif ((b[0][0] + b[1][1] + b[2][2]) == 3) msg.payload = \"X wins\"\nif ((b[2][0] + b[1][1] + b[0][2]) == 3) msg.payload = \"X wins\"\n\n// ----------------------------------------------------------\n// Check to see if O wins \n// Check row 1 - 3\nif ((b[0][0] + b[0][1] + b[0][2]) == 6) msg.payload = \"O wins\"\nif ((b[1][0] + b[1][1] + b[1][2]) == 6) msg.payload = \"O wins\"\nif ((b[2][0] + b[2][1] + b[2][2]) == 6) msg.payload = \"O wins\"\n\n// Check column 1 - 3\nif ((b[0][0] + b[1][0] + b[2][0]) == 6) msg.payload = \"O wins\"\nif ((b[0][1] + b[1][1] + b[2][1]) == 6) msg.payload = \"O wins\"\nif ((b[0][2] + b[1][2] + b[2][2]) == 6) msg.payload = \"O wins\"\n\n// Check DIAGONALS\nif ((b[0][0] + b[1][1] + b[2][2]) == 6) msg.payload = \"O wins\"\nif ((b[2][0] + b[1][1] + b[0][2]) == 6) msg.payload = \"O wins\"\n\n// ----------------------------------------------------------\n// \nif (msg.payload != \"no winner yet\") msg.gameover = \"no\"\nif (msg.payload == \"It's a draw\") msg.gameover = \"draw\"\nif (msg.payload == \"X wins\") msg.gameover = \"yes\"\nif (msg.payload == \"O wins\") msg.gameover = \"yes\"\n\nreturn msg;\n","outputs":1,"noerr":0,"x":610,"y":180,"wires":[[]]},{"id":"94219e5b.949e7","type":"change","z":"e1fd8135.0c3c98","name":"disable square","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":120,"wires":[["10e682f6.b25e1d"]]},{"id":"dfb183f3.faeb4","type":"function","z":"e1fd8135.0c3c98","name":"Mark square used","func":"var square = msg.payload\nvar p = global.get(\"player\")\nvar b = global.get(\"board\")\n//node.warn(\"square =\"+square)\nswitch (square) {\n case 0:\n b[0][0] = p\n break\n case 1:\n b[0][1] = p\n break\n case 2:\n b[0][2] = p\n break\n case 10:\n b[1][0] = p\n break\n case 11:\n b[1][1] = p\n break\n case 12:\n b[1][2] = p\n break\n case 20:\n b[2][0] = p\n break\n case 21:\n b[2][1] = p\n break\n case 22:\n b[2][2] = p\n break\n \n}\nglobal.set(\"board\",b)\nreturn msg;","outputs":1,"noerr":0,"x":210,"y":60,"wires":[["f983ea23.268478"]]},{"id":"6a18278e.6dfca8","type":"tab","label":"Tic-Tac-Toe","disabled":false,"info":""},{"id":"a43b7bc.02cdd08","type":"ui_button","z":"6a18278e.6dfca8","name":"C1 R1","group":"ce6fe386.d4f2f","order":1,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"0","payloadType":"num","topic":"","x":330,"y":200,"wires":[["f98dda3f.0f0d6"]]},{"id":"f1db4e99.415a38","type":"ui_button","z":"6a18278e.6dfca8","name":"C2 R1","group":"7588c2a4.7d2224","order":1,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"1","payloadType":"num","topic":"","x":570,"y":200,"wires":[["6006508d.15e69"]]},{"id":"3eddbd6e.af0b62","type":"ui_button","z":"6a18278e.6dfca8","name":"C3 R1","group":"dfbadba6.ccb018","order":1,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"2","payloadType":"num","topic":"","x":810,"y":200,"wires":[["7b8522b9.deaaa4"]]},{"id":"5db22b5c.c8bd8c","type":"ui_button","z":"6a18278e.6dfca8","name":"C1 R2","group":"ce6fe386.d4f2f","order":2,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"10","payloadType":"num","topic":"","x":330,"y":320,"wires":[["bce1ae1f.4ea5d"]]},{"id":"b2caa5af.01eea8","type":"ui_button","z":"6a18278e.6dfca8","name":"C2 R2","group":"7588c2a4.7d2224","order":2,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"11","payloadType":"num","topic":"","x":570,"y":320,"wires":[["de3e060.7ae1b78"]]},{"id":"a5d3a405.8be1d","type":"ui_button","z":"6a18278e.6dfca8","name":"C3 R2","group":"dfbadba6.ccb018","order":2,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"12","payloadType":"num","topic":"","x":810,"y":320,"wires":[["8eb6de8a.6d895"]]},{"id":"a196841b.2d1d8","type":"ui_button","z":"6a18278e.6dfca8","name":"C1 R3","group":"ce6fe386.d4f2f","order":3,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"20","payloadType":"num","topic":"","x":330,"y":420,"wires":[["56006078.9ab6b"]]},{"id":"f89e331f.a35b8","type":"ui_button","z":"6a18278e.6dfca8","name":"C2 R3","group":"7588c2a4.7d2224","order":3,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"21","payloadType":"num","topic":"","x":570,"y":420,"wires":[["f86c77f6.46f2d"]]},{"id":"682fc612.587d6","type":"ui_button","z":"6a18278e.6dfca8","name":"C3 R3","group":"dfbadba6.ccb018","order":3,"width":"1","height":"1","passthru":false,"label":"","tooltip":"","color":"","bgcolor":"{{color}}","icon":"","payload":"22","payloadType":"num","topic":"","x":810,"y":420,"wires":[["74470e1e.f907c"]]},{"id":"106cc3a4.9dc324","type":"link in","z":"6a18278e.6dfca8","name":"col 1","links":["8d50acd3.847c18","2a1e9927.faccee","81910d4c.fc24e8","a4cc53c0.8adb6"],"x":150,"y":160,"wires":[["a43b7bc.02cdd08","5db22b5c.c8bd8c","a196841b.2d1d8"]],"l":true},{"id":"e2e4aa03.35f4d","type":"link in","z":"6a18278e.6dfca8","name":"col 2","links":["2a1e9927.faccee","8d50acd3.847c18","81910d4c.fc24e8","a4cc53c0.8adb6"],"x":410,"y":160,"wires":[["f1db4e99.415a38","b2caa5af.01eea8","f89e331f.a35b8"]],"l":true},{"id":"4b9567ed.b581b8","type":"link in","z":"6a18278e.6dfca8","name":"col 3","links":["2a1e9927.faccee","8d50acd3.847c18","81910d4c.fc24e8","a4cc53c0.8adb6"],"x":650,"y":160,"wires":[["3eddbd6e.af0b62","a5d3a405.8be1d","682fc612.587d6"]],"l":true},{"id":"2a1e1c78.f83e34","type":"inject","z":"6a18278e.6dfca8","name":"Clear","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":40,"wires":[["b7992c65.b2101"]]},{"id":"b7992c65.b2101","type":"change","z":"6a18278e.6dfca8","name":"","rules":[{"t":"set","p":"ui_control","pt":"msg","to":"{ \"icon\":\"\" }","tot":"json"},{"t":"set","p":"enabled","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"player","pt":"global","to":"1","tot":"num"},{"t":"set","p":"color","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":80,"wires":[["6070b8fb.dde9"]]},{"id":"81910d4c.fc24e8","type":"link out","z":"6a18278e.6dfca8","name":"","links":["106cc3a4.9dc324","4b9567ed.b581b8","e2e4aa03.35f4d"],"x":815,"y":80,"wires":[]},{"id":"f98dda3f.0f0d6","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","x":340,"y":260,"wires":[["a43b7bc.02cdd08","c839a53c.e5ea1"]]},{"id":"bce1ae1f.4ea5d","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":340,"y":360,"wires":[["5db22b5c.c8bd8c","5f2710a5.f9d6e8"]]},{"id":"56006078.9ab6b","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":340,"y":460,"wires":[["a196841b.2d1d8","58f353f3.23ba0c"]]},{"id":"6006508d.15e69","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":580,"y":240,"wires":[["f1db4e99.415a38","8a28057.f9c3278"]]},{"id":"de3e060.7ae1b78","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":580,"y":360,"wires":[["b2caa5af.01eea8","a2cab560.556448"]]},{"id":"f86c77f6.46f2d","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":580,"y":460,"wires":[["f89e331f.a35b8","435f98d5.badea8"]]},{"id":"7b8522b9.deaaa4","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":820,"y":240,"wires":[["3eddbd6e.af0b62","19b5e99b.603d4e"]]},{"id":"8eb6de8a.6d895","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":820,"y":360,"wires":[["a5d3a405.8be1d","2123a7d6.222058"]]},{"id":"74470e1e.f907c","type":"subflow:e1fd8135.0c3c98","z":"6a18278e.6dfca8","name":"","x":820,"y":480,"wires":[["682fc612.587d6","61155ff1.67088"]]},{"id":"b50fff5e.cb36d","type":"ui_button","z":"6a18278e.6dfca8","name":"","group":"836819a8.b435d","order":1,"width":0,"height":0,"passthru":false,"label":"Clear board","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":120,"y":80,"wires":[["b7992c65.b2101","3b574ef0.05086a"]]},{"id":"6070b8fb.dde9","type":"function","z":"6a18278e.6dfca8","name":"set playing board","func":"//var b = {\n// \"R1C1\":{\"XorO\":9, \"status\":0},\n// \"R1C2\":{\"XorO\":9, \"status\":0},\n// \"R1C3\":{\"XorO\":9, \"status\":0},\n// \"R2C1\":{\"XorO\":9, \"status\":0},\n// \"R2C2\":{\"XorO\":9, \"status\":0},\n// \"R2C3\":{\"XorO\":9, \"status\":0},\n// \"R3C1\":{\"XorO\":9, \"status\":0}, \t\n// \"R3C2\":{\"XorO\":9, \"status\":0},\n// \"R3C3\":{\"XorO\":9, \"status\":0}\n// }\n\nvar b = [[9,9,9],[9,9,9],[9,9,9]]\nglobal.set(\"board\",b)\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":80,"wires":[["81910d4c.fc24e8"]]},{"id":"3b574ef0.05086a","type":"change","z":"6a18278e.6dfca8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":640,"wires":[["97cccb47.4d57e"]]},{"id":"5f2710a5.f9d6e8","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":455,"y":360,"wires":[]},{"id":"58f353f3.23ba0c","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":455,"y":460,"wires":[]},{"id":"c839a53c.e5ea1","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":455,"y":260,"wires":[]},{"id":"8a28057.f9c3278","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":695,"y":240,"wires":[]},{"id":"a2cab560.556448","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":695,"y":360,"wires":[]},{"id":"435f98d5.badea8","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":695,"y":460,"wires":[]},{"id":"2123a7d6.222058","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":955,"y":360,"wires":[]},{"id":"19b5e99b.603d4e","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":955,"y":240,"wires":[]},{"id":"61155ff1.67088","type":"link out","z":"6a18278e.6dfca8","name":"","links":["fa782d36.dd9e08"],"x":955,"y":480,"wires":[]},{"id":"fa782d36.dd9e08","type":"link in","z":"6a18278e.6dfca8","name":"check for winner","links":["c839a53c.e5ea1","5f2710a5.f9d6e8","58f353f3.23ba0c","8a28057.f9c3278","a2cab560.556448","435f98d5.badea8","19b5e99b.603d4e","2123a7d6.222058","61155ff1.67088"],"x":360,"y":560,"wires":[["b06cf622.4bcc9","68f68669.b9b188"]]},{"id":"a4cc53c0.8adb6","type":"link out","z":"6a18278e.6dfca8","name":"","links":["106cc3a4.9dc324","4b9567ed.b581b8","e2e4aa03.35f4d"],"x":895,"y":540,"wires":[]},{"id":"b06cf622.4bcc9","type":"switch","z":"6a18278e.6dfca8","name":"game over?","property":"gameover","propertyType":"msg","rules":[{"t":"eq","v":"yes","vt":"str"},{"t":"eq","v":"draw","vt":"str"},{"t":"eq","v":"no","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":490,"y":560,"wires":[["33d1c7dd.d312a","97cccb47.4d57e"],["c642a0ba.f8095","97cccb47.4d57e"],[]]},{"id":"33d1c7dd.d312a","type":"change","z":"6a18278e.6dfca8","name":"Lock all squares","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"},{"t":"delete","p":"ui_control.icon","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":540,"wires":[["a4cc53c0.8adb6"]]},{"id":"68f68669.b9b188","type":"debug","z":"6a18278e.6dfca8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":520,"wires":[]},{"id":"c642a0ba.f8095","type":"change","z":"6a18278e.6dfca8","name":"Lock all squares","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"},{"t":"delete","p":"ui_control.icon","pt":"msg"},{"t":"set","p":"color","pt":"msg","to":"grey","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":580,"wires":[["a4cc53c0.8adb6"]]},{"id":"97cccb47.4d57e","type":"ui_template","z":"6a18278e.6dfca8","group":"f6cdc117.7b9e98","name":"","order":0,"width":0,"height":0,"format":"<script>\n (function(scope) {\n scope.$watch('msg', function(data) {\n var elem = document.getElementById(\"headerStatus\")\n if(elem !== null) {\n elem.className = data.payload;\n elem.innerHTML = data.payload;\n }\n });\n })(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":640,"y":640,"wires":[[]]},{"id":"88415bb3.abdda","type":"ui_template","z":"6a18278e.6dfca8","group":"deab7dfc.0fa5c8","name":"Header Status","order":2,"width":"0","height":"0","format":"<style>\n #headerStatus {\n font-weight: bold;\n text-transform: uppercase;\n }\n #headerStatus.online {\n color: lime;\n }\n #headerStatus.offline {\n color: tomato;\n }\n</style>\n\n<script id=\"titleScript\" type=\"text/javascript\">\n$(function() {\n if($('.md-toolbar-tools').length){\n initHeader();\n } else setTimeout(initHeader, 500)\n});\n\nfunction initHeader(){\n if (!$('#headerStatus').length) {\n var toolbar = $('.md-toolbar-tools');\n var div = $('<div/>');\n var p = $('<p id=\"headerStatus\" />');\n div[0].style.margin = 'auto';\n div.append(p);\n toolbar.append(div);\n }\n}\n</script>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"global","x":660,"y":680,"wires":[[]]},{"id":"ce6fe386.d4f2f","type":"ui_group","z":"","name":"column 1","tab":"5475d0db.eab538","order":2,"disp":false,"width":"1","collapse":false},{"id":"7588c2a4.7d2224","type":"ui_group","z":"","name":"column 2","tab":"5475d0db.eab538","order":3,"disp":false,"width":"1","collapse":false},{"id":"dfbadba6.ccb018","type":"ui_group","z":"","name":"column 3","tab":"5475d0db.eab538","order":4,"disp":false,"width":"1","collapse":false},{"id":"836819a8.b435d","type":"ui_group","z":"","name":"Group 4","tab":"5475d0db.eab538","order":5,"disp":false,"width":"1","collapse":false},{"id":"f6cdc117.7b9e98","type":"ui_group","z":"","name":"Group 5","tab":"5475d0db.eab538","order":1,"disp":false,"width":"3","collapse":false},{"id":"deab7dfc.0fa5c8","type":"ui_group","z":"","name":"text-in-header-bar","tab":"e80f786d.50a758","disp":true,"width":"6","collapse":false},{"id":"5475d0db.eab538","type":"ui_tab","z":"","name":"Small Grid","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"e80f786d.50a758","type":"ui_tab","z":"","name":"Home2","icon":"dashboard","disabled":false,"hidden":false}]
Comments/suggestions welcome