<?lc put header "Content-Type: text/html; charset=utf-8" ?> <html> <head> <title>インターラクティブ 一茶俳句上中下句抜々粋々 縦書き</title> <style type="text/css"> a:link {color: #333; text-decoration: none; } a:visited {color: #333; } a:hover {color: #999; } a:active {color: #999; } .bodyS { color: #333; font-size: 11px; font-family: SunSans-Regular, sans-serif; line-height: 12px } .body {font-size:16px; font-family:"MS 明朝","monospace"; } /* 明朝体 */ #container{ font-size:24px; font-family:"MS 明朝","monospace"; position: relative; margin: 0 auto; text-align: center; width: 700px; } </style> </head> <?lc include "script.lc" ?> <body> <span class="bodyS"> <a href="http://kenjikojima.com/haiku/"><b>LiveCodeを使って俳句 目次</b></a> <br> <a href="index.lc?file=index.lc">LiveCodeを見る。</a><br> <a href="issaData.html" target="blank">データ収集コード</a><br> <a href="mailto:index@kenjikojima.com">index@kenjikojima.com</a><br> <!-- <a href="http://downloads.livecode.com/livecode/">LiveCode Community Server</a>が必要です。<br> --> </span> <div id="container"> <a href="javascript:void(0)" onclick="window.location.reload()"> <?lc --プログラミング言語は LiveCodeで書いています。 -- データを読み込む get url ("file:issa.txt") set itemDel to comma put any line of it into line1 put item 1 of line1 into tKami replace comma with " " in line1 put any line of it into line2 put item 2 of line2 into tNaka replace comma with " " in line2 put any line of it into line3 put item 3 of line3 into tShimo replace comma with " " in line3 put "<span class='container'>一茶俳句上中下句抜々粋々 縦書き</span><br>" put "<span class='bodyS'>小林一茶の俳句の上句・中句・下句からそれぞれ抜粋して縦書きします。<br>もとの句<br>上句:" & \ line1 &"<br>中句:"& line2 &"<br>下句:"& line3 &"</span><br><br>" -- 最も長い句の文字数を得る put max(the num of chars of tKami, the num of chars of tNaka, the num of chars of tShimo) into tMax -- 長い文字数に空白を揃える repeat with i = 1 to tMax if the num of chars of tKami<= tMax then put " " after tKami if the num of chars of tNaka <= tMax then put " " after tNaka if the num of chars of tShimo <= tMax then put " " after tShimo end repeat -- 文字数を3ステップごとに纏めてゆく repeat with i=1 to tMax step 3 -- put char i to i + 2 of tSaku & " " after tHaiku put char i to i + 2 of tShimo & " " after tHaiku put char i to i + 2 of tNaka & " " after tHaiku put char i to i + 2 of tKami & "<br>" &cr after tHaiku end repeat -- 縦文字用のカッコに変換 replace "(" with "︵" in tHaiku replace ")" with "︶" in tHaiku -- HTMLに出力 put tHaiku ?> </a> </div> </body> </html>