再继(太长了)
发表于:2007-06-30来源:作者:点击数:
标签:
function buildStyle3(inputText,booleanRepeat) { var newline = false; var line0 = ; var line1 = ; var line2 = ; var space = ; var a = new Array(3); var b = new Array(3); var c = new Array(3); var d = new Array(3); var e = new Array(3); var f
function buildStyle3(inputText,booleanRepeat) {
var newline = false; var line0 = ""; var line1 = ""; var line2 = ""; var space = " "; var a = new Array(3); var b = new Array(3); var c = new Array(3); var d = new Array(3); var e = new Array(3); var f = new Array(3); var g = new Array(3); var h = new Array(3); var I = new Array(3); var j = new Array(3); var k = new Array(3); var l = new Array(3); var m = new Array(3); var n = new Array(3); var o = new Array(3); var p = new Array(3); var q = new Array(3); var r = new Array(3); var s = new Array(3); var t = new Array(3); var u = new Array(3); var v = new Array(3); var w = new Array(3); var x = new Array(3); var y = new Array(3); var z = new Array(3); var zero = new Array(3); var one = new Array(3); var two = new Array(3); var three = new Array(3); var four = new Array(3); var five = new Array(3); var six = new Array(3); var seven = new Array(3); var eight = new Array(3); var nine = new Array(3);
a[0] = "/痋\ "; a[1] = "|瘄 "; a[2] = " ";
b[0] = "|? "; b[1] = "|? "; b[2] = " ? ";
c[0] = "|?"; c[1] = "|_ "; c[2] = " ";
d[0] = "|痋\ "; d[1] = "|_/ "; d[2] = " ";
e[0] = "|?"; e[1] = "|?"; e[2] = " ?";
f[0] = "|?"; f[1] = "|?"; f[2] = " ";
g[0] = "|? "; g[1] = "| | "; g[2] = " ? ";
h[0] = "| | "; h[1] = "|瘄 "; h[2] = " ";
I[0] = "| "; I[1] = "| "; I[2] = " ";
j[0] = " 瘄?"; j[1] = "|_| "; j[2] = " ";
k[0] = "|/ "; k[1] = "|痋\ "; k[2] = " ";
l[0] = "| "; l[1] = "|_ "; l[2] = " ";
m[0] = "|\\/| "; m[1] = "| | "; m[2] = " ";
n[0] = "|\\| "; n[1] = "| | "; n[2] = " ";
o[0] = "|瘄 "; o[1] = "|_| "; o[2] = " ";
p[0] = "|瘄 "; p[1] = "|? "; p[2] = " ";
q[0] = "|瘄 "; q[1] = "|_|?"; q[2] = " ";
r[0] = "|瘄 "; r[1] = "|痋\ "; r[2] = " ";
s[0] = "|? "; s[1] = " 瘄 "; s[2] = " ? ";
t[0] = "瘄?"; t[1] = " | "; t[2] = " ";
u[0] = "| | "; u[1] = "|_| "; u[2] = " ";
v[0] = "\\ | "; v[1] = " \\| "; v[2] = " ";
w[0] = "\\ |\\ | "; w[1] = " \\| \\| "; w[2] = " ";
x[0] = "\\/ "; x[1] = "/\\ "; x[2] = " ";
y[0] = "\\| "; y[1] = " | "; y[2] = " ";
z[0] = "? "; z[1] = "/_ "; z[2] = " ";
zero[0] = "|瘄 "; zero[1] = "|/| "; zero[2] = " ? ";
one[0] = "@#| "; one[1] = " | "; one[2] = " ";
two[0] = " 瘄 "; two[1] = "|? "; two[2] = " ? ";
three[0] = "瘄 "; three[1] = "瘄 "; three[2] = "? ";
four[0] = "/ | "; four[1] = " 瘄 "; four[2] = " ";
five[0] = "|? "; five[1] = " 瘄 "; five[2] = " ? ";
six[0] = "|? "; six[1] = "|瘄 "; six[2] = " ? ";
seven[0] = "? "; seven[1] = "/ "; seven[2] = " ";
eight[0] = "|瘄 "; eight[1] = "|瘄 "; eight[2] = " ? ";
nine[0] = "|瘄 "; nine[1] = " 瘄 "; nine[2] = " ";
for(i=0; i < inputText.length; i++) {
if(inputText.charAt(i) == " ") {line0 += space; line1 += space; line2 += space}
if(inputText.charAt(i) == "a") {line0 += a[0]; line1 += a[1]; line2 += a[2]}
if(inputText.charAt(i) == "b") {line0 += b[0]; line1 += b[1]; line2 += b[2]}
if(inputText.charAt(i) == "c") {line0 += c[0]; line1 += c[1]; line2 += c[2]}
if(inputText.charAt(i) == "d") {line0 += d[0]; line1 += d[1]; line2 += d[2]}
if(inputText.charAt(i) == "e") {line0 += e[0]; line1 += e[1]; line2 += e[2]}
if(inputText.charAt(i) == "f") {line0 += f[0]; line1 += f[1]; line2 += f[2]}
if(inputText.charAt(i) == "g") {line0 += g[0]; line1 += g[1]; line2 += g[2]}
if(inputText.charAt(i) == "h") {line0 += h[0]; line1 += h[1]; line2 += h[2]}
if(inputText.charAt(i) == "i") {line0 += I[0]; line1 += I[1]; line2 += I[2]}
if(inputText.charAt(i) == "j") {line0 += j[0]; line1 += j[1]; line2 += j[2]}
if(inputText.charAt(i) == "k") {line0 += k[0]; line1 += k[1]; line2 += k[2]}
if(inputText.charAt(i) == "l") {line0 += l[0]; line1 += l[1]; line2 += l[2]}
if(inputText.charAt(i) == "m") {line0 += m[0]; line1 += m[1]; line2 += m[2]}
if(inputText.charAt(i) == "n") {line0 += n[0]; line1 += n[1]; line2 += n[2]}
if(inputText.charAt(i) == "o") {line0 += o[0]; line1 += o[1]; line2 += o[2]}
if(inputText.charAt(i) == "p") {line0 += p[0]; line1 += p[1]; line2 += p[2]}
if(inputText.charAt(i) == "q") {line0 += q[0]; line1 += q[1]; line2 += q[2]}
if(inputText.charAt(i) == "r") {line0 += r[0]; line1 += r[1]; line2 += r[2]}
if(inputText.charAt(i) == "s") {line0 += s[0]; line1 += s[1]; line2 += s[2]}
if(inputText.charAt(i) == "t") {line0 += t[0]; line1 += t[1]; line2 += t[2]}
if(inputText.charAt(i) == "u") {line0 += u[0]; line1 += u[1]; line2 += u[2]}
if(inputText.charAt(i) == "v") {line0 += v[0]; line1 += v[1]; line2 += v[2]}
if(inputText.charAt(i) == "w") {line0 += w[0]; line1 += w[1]; line2 += w[2]}
if(inputText.charAt(i) == "x") {line0 += x[0]; line1 += x[1]; line2 += x[2]}
if(inputText.charAt(i) == "y") {line0 += y[0]; line1 += y[1]; line2 += y[2]}
if(inputText.charAt(i) == "z") {line0 += z[0]; line1 += z[1]; line2 += z[2]}
if(inputText.charAt(i) == "0") {line0 += zero[0]; line1 += zero[1]; line2 += zero[2]}
if(inputText.charAt(i) == "1") {line0 += one[0]; line1 += one[1]; line2 += one[2]}
if(inputText.charAt(i) == "2") {line0 += two[0]; line1 += two[1]; line2 += two[2]}
if(inputText.charAt(i) == "3") {line0 += three[0]; line1 += three[1]; line2 += three[2]}
if(inputText.charAt(i) == "4") {line0 += four[0]; line1 += four[1]; line2 += four[2]}
if(inputText.charAt(i) == "5") {line0 += five[0]; line1 += five[1]; line2 += five[2]}
if(inputText.charAt(i) == "6") {line0 += six[0]; line1 += six[1]; line2 += six[2]}
if(inputText.charAt(i) == "7") {line0 += seven[0]; line1 += seven[1]; line2 += seven[2]}
if(inputText.charAt(i) == "8") {line0 += eight[0]; line1 += eight[1]; line2 += eight[2]}
if(inputText.charAt(i) == "9") {line0 += nine[0]; line1 += nine[1]; line2 += nine[2]}
if(inputText.substring(i,(i+2)) == "\\n") {var newline = true; break}
}
if(newline == true) {
var outputText = line0+"\n"+line1+"\n"+line2;
document.ascii.outputField.value = outputText;
buildStyle3(inputText.substring((i+2),inputText.length),1);
} else {
var outputText = line0+"\n"+line1+"\n"+line2;
if(booleanRepeat) {document.ascii.outputField.value += "\n"+outputText}
else {document.ascii.outputField.value = outputText}
}
}
-->
</script>
<form name=ascii>
<b>请输入:</b><br>
<table cellpadding=0>
<tbody>
<tr>
<
td>内容:
<input name=inputField>
<td>字体风格:
<select name=textStyle>
<option>Futuristik
<option selected>Block
<option >Wireframe</option>
</select>
</td>
<td>
<input onClick=beginGenerator() type=button value=生成ASCII字形 name="button">
</td>
</tr>
<tr>
<td></td>
<td align=middle>
<p></p>
</td>
</tr>
</tbody>
</table>
<span id=windowMarker><b>Output:</b><br>
<textarea name=outputField rows=10 wrap=off cols=88></textarea>
</span>
<div id=style1 title="Preview of Futuristik - Click To Close"
style="DISPLAY: none; CURSOR: hand; POSITION: absolute; zindex: 100"></div>
<div id=style2 title="Preview of Block - Click To Close"
style="DISPLAY: none; CURSOR: hand; POSITION: absolute; zindex: 100">
<table border=1>
<tbody>
<tr>
<td bordercolor=#c0c0c0 align=middle border="0">Click To Close
<p>
<pre> _____ _ _____ _____ _ _
| _ \ | | / _ \ / ___| | | / /
| |_| | | | | | | | | | | |/ /
| _ { | | | | | | | | | |\ \
| |_| | | |___ | |_| | | |___ | | \ \
|_____/ |_____| \_____/ \_____| |_| \_\ </pre>
</td>
</tr>
</tbody>
</table>
</div>
<div id=style3 title="Preview of Wireframe - Click To Close"
style="DISPLAY: none; CURSOR: hand; POSITION: absolute; zindex: 100">
<table border=1>
<tbody>
<tr>
<td bordercolor=#c0c0c0 align=middle border="0">Click To Close
<p>
<pre>\ |\ | | |瘄 |?|?|瘄 /痋 |\/| |?
\| \| | |痋 |?|?|痋 |瘄 | | |?
? ?</pre>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</
TD>
<TD><IMG src="/images/space.gif"
width=11 height="1"></TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR bgColor=#ffffff>
<TD><IMG src="/images/sq_3.gif" width=11 height="14"></TD>
<TD width="100%"></TD>
<TD><IMG src="/images/sq_4.gif"
width=11 height="14"></TD>
</TR>
</TABLE>
</BODY>
</HTML>
不支持中文
无忧脚本 51JS.COM
原文转自:http://www.ltesting.net