Re: Greek PHP mailing list

From: Date: Fri, 26 Jan 2001 17:56:31 +0000
Subject: Re: Greek PHP mailing list
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-36831@lists.php.net to get a copy of this message
> The options: Get a graph-link cable (which I can't find ANYWHERE), or make > your own during study hall, making them sufficiently stupid that the code can > be compressed down to a screenful: > > kyk():Prgm:Local a,b,c:13->a:"|------------+------------|"->b:ClrIO:Output > 0,-1,left(b,a)&"¥"&right(b,a):While abs(13-a)<13:getKey()->c:If > abs(50-c)=1 > Then:a+c-50->a:Output > 0,-1,left(b,a)&"¥"&right(b,26-a):EndIf:EndWhile:EndPrgm > > Play with the 1 and 3 keys. Guess what it does by just looking at the code, > and win a free donut (should arrive within 6-8 weeks, and shouldn't be too > stale by then). 1 and 3 have character codes 49 and 51, respectively, if you > want to take this on... I must admit it is shorter code than javascript would be: (ie4+, NS4+) <html> <head> <script language="javascript1.2"> ns4 = (document.layers)? true:false ie4 = (document.all)? true:false document.a=13 function keyDown(e) { a=document.a b="|------------+------------|"; if (ns4) {var keycode = e.which-50; } if (ie4) {var keycode = event.keyCode-50; } if (Math.abs(keycode)==1){ a=a+keycode if ((Math.abs(a-13))>12) {alert("CRASH!");document.TI.ROAD.value="************************";document.a =13;return 0;} document.TI.ROAD.value=(b.substring(0,a)+"¥"+ b.substr(a,26)) } document.a=a } document.onkeydown = keyDown document.captureEvents(Event.KEYDOWN) </script> <body> Do not click inside screen. Press 1 to go left, 3 to go right (on keyboard). <table border=1 bgcolor="#D0D0D0"> <tr><td colspan=3 align=right><font size=2 type="arial,helvetica,sans- serif">Javascript instrument</font></tr> <tr><td colspan=3> <FORM NAME="TI"> <INPUT TYPE="TEXT" NAME="ROAD" size="30"> </FORM> </td></tr> <tr><td>SQRT<td>MEM<td>COS</tr> <tr><td>7<td>8<td>9</tr> <tr><td>4<td>5<td>6</tr> <tr><td>1<td>2<td>3</tr> <tr><td>&nbsp;<td>0<td>&nbsp;</tr> </table> </body> </html> -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------

« previous php.general (#36831) next »