-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.js
33 lines (26 loc) · 986 Bytes
/
layout.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!--
// verbose mode
if (verbose) {verboseMode("load: layout.js");}
// this is the script that defines the layout for the visual representation of the AISnake simulation.
// lukas
for (y=0;y<s;y++) {
document.write('<tr height="'+100/s+'%" border="0">');
for (x=0;x<s;x++) {
for (i=0;blockX[i]!=null;i++) {if (x == blockX[i] && y == blockY[i]) {document.write('<td ID="feed'+((y*s)+x+1)+'" colspan="'+(blockW[i]+1)+'" rowspan="'+(blockH[i]+1)+'">'+blockC[i]+'</td>');}}
document.write('<td ID="feed'+((y*s)+x+1)+'" width="'+100/s+'%" onMouseOver="clickFeed('+y+','+x+')" onClick="addSnakeXY('+x+','+y+')"> </td>');
}
document.write('</tr>');
}
document.write('</table>');
function clickFeed(x,y) {
//feedSnakeXY(y,x);
}
function addSnakeXY(x,y) {
sC++;
colorSnake(sC-1);
InitXY(sC-1,x,y,randomGenes("User", "Top"));
if (updateStats==true) {updateStatsWin();}
}
// verbose mode
if (verbose) {verboseMode("done: layout.js");}
-->