User:Joak/colorroute: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 1: Line 1:
<source lang="javascript">
<source lang="javascript">
something
#!/usr/bin/env python
 
for x in range(0, 16777216):
name = hex(x).lstrip("0x")
neext = hex(x+1).lstrip("0x")
while len(name) < 6:
name = "0" + name
while len(neext) < 6:
neext = "0" + neext
file=open("tests/"+name+".html","w+")
if x == 16777215:
file.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>the famous color route #"""+name+""""</title>
<meta name="author" content="joak">
<script language="javascript" type="text/javascript">
window.setTimeout("window.location = '000000.html'",5000);
</script>
</head>
<body bgcolor="#"""+name+"""">
<div style="position:absolute;left:50%;top:50%;"><center><input type="button" onclick="window.location.href = '000000.html';" value="again"></center></div>
</body>
</html>""")
else:
file.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>the famous color route #"""+name+""""</title>
<meta name="author" content="joak">
<script language="javascript" type="text/javascript">
window.setTimeout("window.location = '"""+neext+""".html'",0);
</script>
</head>
<body bgcolor="#"""+name+"""">
</body>
</html>""")
file.close()
print name

Revision as of 22:51, 8 July 2013

<source lang="javascript">

  1. !/usr/bin/env python

for x in range(0, 16777216): name = hex(x).lstrip("0x") neext = hex(x+1).lstrip("0x") while len(name) < 6: name = "0" + name while len(neext) < 6: neext = "0" + neext file=open("tests/"+name+".html","w+") if x == 16777215: file.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>the famous color route #"""+name+""""</title> <meta name="author" content="joak"> <script language="javascript" type="text/javascript"> window.setTimeout("window.location = '000000.html'",5000); </script> </head> <body bgcolor="#"""+name+"""">

<input type="button" onclick="window.location.href = '000000.html';" value="again">

</body> </html>""") else: file.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>the famous color route #"""+name+""""</title> <meta name="author" content="joak"> <script language="javascript" type="text/javascript"> window.setTimeout("window.location = '"""+neext+""".html'",0); </script> </head> <body bgcolor="#"""+name+""""> </body> </html>""") file.close() print name