% #include "knot.h" %>
<% static void print_img(int ptrn) { %>
<% if (ptrn) { %>
<% if (ptrn & RIGHT) printf("r"); %>
<% if (ptrn & UP ) printf("u"); %>
<% if (ptrn & DOWN ) printf("d"); %>.png">
<% } %>
<% } %>
<% void print_index(row_t *rows) { %>
<% print_img(rows[row].cols[col].bot); %> <% print_img(rows[row].cols[col].top); %> | <% } %>