Griffin
<html>
<head>
<script type="text/javascript">
var alphabet = 'abcdefghijklmnopqrstuvwxyz'
var current = [];
var shapes = [];
function createBox( x, y ) {
b = document.createElement( 'button' );
b.style.position = 'absolute';
b.style.width = '5px';
b.style.height = '5px';
b.style.left = ( 100 + 20*x ) + 'px';
b.style.top = ( 100 + 20*y ) + 'px';
b.tx = alphabet[x];
b.ty = alphabet[y];
b.onclick = function( e ) { current.push( [ e.target.tx, e.target.ty ] ) };
return b;
}
function trasferCurrent( type ) {
s = '';
for ( i=0; i<current.length; i++ ) {
s += current[ i ][0] + current[ i ][1];
}
shapes.push( s+type );
current = [];
}
window.onload = function() {
for ( x=0; x<10; x++ ) {
for ( y=0; y<18; y++ ) {
b = createBox( x, y );
document.body.appendChild( b );
}
}
b1 = document.getElementById( 'b1' );
b2 = document.getElementById( 'b2' );
b3 = document.getElementById( 'b3' );
b4 = document.getElementById( 'b4' );
b9 = document.getElementById( 'b9' );
b1.onclick = b2.onclick = b3.onclick = b4.onclick = b9.onclick = function( e ) {
trasferCurrent( e.target.id[1] );
};
};
</script>
</head>
<body>
<button id="b1">end white</button>
<button id="b2">end black</button>
<button id="b3">end hole</button>
<button id="b4">end ghost</button>
<button id="b9">end line</button>
</body>
</html>
31
answers
4
questions
~155k
people reached
-
Member for 9 years, 8 months
-
229 profile views
-
Last seen Mar 24 at 12:55
Communities (26)
Top network posts
Badges (59)
Gold
3
Rarest
-
May 13 '16
-
Mar 23
-
Aug 16 '17
Silver
27
Rarest
-
Aug 25
-
Dec 24 '13
-
Jun 18 '19
Bronze
29
Rarest
-
Jul 4 '12
-
Sep 30 '14
-
Jul 4 '12