Stats
4,735
reputation
186k
reached
32
answers
4
questions
Loading…
About
<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>
Badges
View all badges
3
gold badges
-
PopulistMay 13, 2016
-
Great AnswerMar 23, 2021
-
Famous QuestionAug 16, 2017
30
silver badges
-
Favorite QuestionAug 25, 2020
-
LifejacketJun 18, 2019
-
GuruDec 24, 2013
29
bronze badges
-
TumbleweedJul 4, 2012
-
ExplainerSep 30, 2014
-
OrganizerJul 4, 2012
Top tags
View all tags
254
Score
26
Posts
72
Posts %
131
Score
8
Posts
22
Posts %
89
Score
2
Posts
6
Posts %
31
Score
3
Posts
8
Posts %
26
Score
5
Posts
14
Posts %
23
Score
2
Posts
6
Posts %
Top network posts
View all network posts