#JavaScript, 360 As requested, text based game, input via popup, output in console (so to have a monospaced font). Quit game with 'q' or clicking 'cancel' at prompt. Not using ES5 features, it should run on any moder browser (where you can have a JS console panel) <!-- begin snippet: js hide: false --> <!-- language: lang-js --> b='\n......'.repeat(6).split(''); for(h=t=0;!h&t<36;) { i=prompt(); if(i=='q')i=null; i=i.match(/([0-5]) ([0-5]) ([XO])/); m='INVALID'; if(b[p=i?i[2]*7-~i[1]:0]=='.') { ++t; b[p]=i[3]; m=b.join(''); for(x=z='',c=0;c++<6;) for(x+='_',z+='_',r=0;r<6;r++) x+=b[c+r*7],z+=b[c<4?c-1+r*8:c+1+r*6]; h=(/X{5}|O{5}/.test(b.join('')+x+z)) } console.log(m); } console.log("P"+(2-h)+" WINS") <!-- end snippet --> **Now, some more fun** Interactive and graphic version, run snippet to play. <!-- begin snippet: js hide: true --> <!-- language: lang-js --> b='\n......'.repeat(6).split(''); t=0 sel='X' function show() { var w,p p=t&1 $('#B').addClass('OC'[p]).removeClass('CO'[p]); w=b.map(function(c,i){ return c>' '?'<td class='+(c=='.'?'F':'X')+' id=C'+i+'>'+c+'</td>':'</tr><tr>' }).join(''); $('#B').html('<tr><th colspan=6>Playing: '+(['Order','Chaos'][p]) + '</th><tr><tr><td colspan=6>' + '<input type=radio name=S value=X' + (sel=='X'?' checked':'')+ '>X '+ '<input type=radio name=S value=O' + (sel=='O'?' checked':'')+ '>O</td>'+ w +'</tr>'); } show() $('#B').on('click','td.F',function(){ var x,y, p=~~this.id.slice(1) x=p%7-1 y=p/7|0 sel=b[p]=$('input[type=radio]:checked').val(); ++t for(x=z='',c=0;c++<6;) for(x+='_',z+='_',r=0;r<6;r++) x+=b[c+r*7],z+=b[c<4?c-1+r*8:c+1+r*6]; if (/X{5}|O{5}/.test(b.join('')+x+z)) { alert('P1 (ORDER) WINS') b='\n......'.repeat(6).split(''); t=0 } else if(t==6*6) { alert('P2 (CHAOS) WINS') b='\n......'.repeat(6).split(''); t=0 } show() }) <!-- language: lang-css --> th { font-size: 12px; } table.C th { color: #807; } table.O th { color: #087; } td { font-family: monospace; font-size: 12px; width: 1em; height: 1em; text-align: center; } table.C td.F:hover { background: #f0e; } table.O td.F:hover { background: #0fe; } <!-- language: lang-html --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table id=B></table> <p id=O></p> <!-- end snippet -->