User:Joak/colorroute

From XPUB & Lens-Based wiki
< User:Joak
Revision as of 22:51, 8 July 2013 by Joak (talk | contribs)

<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