Advertisement
Guest User

Untitled

a guest
Nov 26th, 2010
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. {import IO; import Network; main= do{so <-lo$ 8000; al$so ;};al so=do{ (h,_,_) <-accept$ so;hr$h;al$so ;};r=replicate;c =concat;sl=cm$g;cm =concatMap;lo=listenOn. PortNumber;s=' ';l1=sl$[(36 ,s),(4,'~')];g (n,ch)=(r$ n)$ch;l2=sl$[ (33,s),( 10,'~')];hr h=do{(hps $h)$("HTTP" ++"/1.1" ++[s]++"200" ++[s]++ "OK\r\n\r\n" ++b);hc$h; };b="<!doct" ++"ype"++ [s]++"html>" ++"<pre>" ++a++"</pre>" ;l3=sl$[( 31,s),(1,'~') ,(12,'o') ,(1,'~')];l4= sl$[(30,s ),(6,'~'),(4, 'o'),(6, '~')];l5=sl$ [(29,s),( 18,'~')];l6= sl$[(28,s) ,(20,'~')];l7 st=((r$27) $s)++(c$((r$11 )$st));l8= sl$[(27,s),(22, 'X')];l9=((r 26)$s) ++"(X"++(c$((r $10)$"\\/")) ++"X)" ;hps=hPutStr; hc=hClose; t=[l1, l2,l3,l4,l5, l6];a=(cm$(++"\n"))$(t++[l7$"/\\" ,l8,l9,l8,l7$"\\/" ]++(reverse$t))}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement