The following is VBScript so Netscape users will not see the results
Start a loop and then start another loop. If the second loop is less than the first loop type an X. Since both start at 0 the first loop will be on 2 when the second loop is on 1 (and so on), the second loop is less than the first loop and it writes an X. The first loop supplies the break.
I used two for statements and two if statements, one saying if the second loop was less than the second type X's and the other saying if the second loop is greater than the first loop type K's.