1 <% #include "knot.h" %>
3 <% static void print_img(int ptrn) { %>
5 <img src="img/<% if (ptrn & LEFT ) printf("l"); %>
6 <% if (ptrn & RIGHT) printf("r"); %>
7 <% if (ptrn & UP ) printf("u"); %>
8 <% if (ptrn & DOWN ) printf("d"); %>.png">
12 <% void print_index(row_t *rows) { %>
13 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
14 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
15 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
17 <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
19 <style type="text/css">
20 td { min-width:64px; height:64px; }
21 img { position:absolute; }
25 <table cellpadding="0" cellspacing="0">
26 <% for (int row = 1; rows[row].cols; row++) { %>
28 <% for (int col = 1; col < rows[row].ncols; col++) { %>
30 <% print_img(rows[row].cols[col].bot); %>
31 <% print_img(rows[row].cols[col].top); %>