Edit Modified interactive game, should run even in MSIE
As requested, text based game, input via popup, output in console (so to have a monospaced font).
function start() {
b='\nb=Array(7).join('\n......'.repeat(6).split('');
t=0;
$('#O').text('');
$('table')[0].className='';
show();
$('th').eq(1).html('Left-click: O<br>Right-click: X');
$('#B')
.off('mouseup')
.on('mouseup','td.F',function(ev){
var x,y, p=~~this.id.slice(1)
x=p%7-1
y=p/7|0
b[p]=ev.which > 1 ?'X':'O';
++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];
show()
if (/X{5}|O{5}/.test(b.join('')+x+z))
end(1)
else if(t==6*6)
end(2)
return false
})
}
function end(w) {
var n=['Order','Chaos'][w-1]
$('th').eq(0).text('P'+w+' '+n+' Wins')
$('th').eq(1).text('Click to play again')
$('table')[0].className=$('tr')[0].className =n[0];
$('#B').off('mouseup').on('mouseup', start)
}
function show() {
var w,p
p=t&1
$('tr')[0].className=$('#B')[0].className='OC'[p];
w=b.map(function(c,i){
return c>' '?'<td class='+(c=='.'?'F':'X')+' id=C'+i+'>'+c+'</td>':'</tr><tr>'
}).join('');
$('th').eq(0).text('Playing: '+['Order','Chaos'][p]);
$('#B').html('<tr>' + w +'</tr>');
}
start()
th {
font-size: 12px;
}
.C th { color: #807; }
.O th { color: #047; }
.C td.F:hover { background: #f0e; }
.O td.F:hover { background: #0fe; }
table.C td { background: #f0e; }
table.O td { background: #0fe; }
td {
font-family: monospace;
font-size: 12px;
width: 1.2em;
height: 1em;
text-align: center;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<table>
<tr><th colspan=6></th></tr>
<tbody id=B></tbody>
<tr><th colspan=6></th></tr>
</table>
<p id=O></p>