Articulos PHP
Octubre 11, 2008, 03:43:04 *
Bienvenido(a), Visitante. Por favor, ingresa o regístrate.

Ingresar con nombre de usuario, contraseña y duración de la sesión
Noticias: Canciones Traducidas - Daforos.com - Fondos Gratis - Portatiles - Hosting - - Recursos Gratuitos Webmaster - elhacker dragonjar - sexo gratis - letras de canciones - Trucos Gratis - Juegos Gratis - Sexe gratuit - Juegos De Coche - porno - Start - Page0 - Page1 - Page2 - Page3 - Page4 - Page5 - Page6 - Page7 - Page8 - Page9 - Page10Page11 - Page12 - Page13 - Page14 - Page15 - Page16 - Page17 - Page18 - Page19 - Page20Page21 - Page22 - Page23 - Page24 - Page25 - Page26 - Page27 - Page28 - Page29 -

Páginas: 1   Ir Abajo
  Imprimir  
Autor Tema: El "ahorcado" , el juego  (Leído 3171 veces)
administrador
Administrator
Hero Member
*****
Desconectado Desconectado

Mensajes: 16876


Ver Perfil
« : Septiembre 16, 2004, 04:10:25 »

Este Script es el clásico juego del ahorcado.
Las palabras se pueden cambiar editando el Array Words[].


<script language="javascript">
var words=new Array();
words[0] = "GEORGE WASHINGTON";
words[1] = "JOHN ADAMS";
words[2] = "THOMAS JEFFERSON";
words[3] = "JAMES MADISON";
words[4] = "JAMES MONROE";
words[5] = "JOHN QUINCY ADAMS";
words[6] = "ANDREW JACKSON";
words[7] = "MARTIN VAN BUREN";
words[8] = "WILLIAM HENRY HARRISON";
words[9] = "JOHN TYLER";
words[10] = "JAMES POLK";
words[11] = "ZACHARY TAYLOR";
words[12] = "MILLARD FILLMORE";
words[13] = "FRANKLIN PIERCE";
words[14] = "JAMES BUCHANAN";
words[15] = "ABRAHAM LINCOLN";
words[16] = "ANDREW JOHNSON";
words[17] = "ULYSSES GRANT";
words[18] = "RUTHERFORD HAYES";
words[19] = "JAMES GARFIELD";
words[20] = "CHESTER ARTHUR";
words[21] = "GROVER CLEVELAND";
words[22] = "BENJAMIN HARRISON";
words[23] = "GROVER CLEVELAND";
words[24] = "WILLIAM MCKINLEY";
words[25] = "THEODORE ROOSEVELT";
words[26] = "WILLIAM HOWARD TAFT";
words[27] = "WOODROW WILSON";
words[28] = "WARREN HARDING";
words[29] = "CALVIN COOLIDGE";
words[30] = "HERBERT HOOVER";
words[31] = "FRANKLIN ROOSEVELT";
words[32] = "HARRY TRUMAN";
words[33] = "DWIGHT EISENHOWER";
words[34] = "JOHN KENNEDY";
words[35] = "LYNDON JOHNSON";
words[36] = "RICHARD NIXON";
words[37] = "GERALD FORD";
words[38] = "JIMMY CARTER";
words[39] = "RONALD REAGAN";
words[40] = "GEORGE BUSH";
words[41] = "BILL CLINTON";
alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
ltr=0; ltc=0;
for (i=0;i<2;i++)
{
   document.write("<tr>");
   for (j=0;j<13;j++)
     { a='<td><tt><input type="button" value=" ';
     a+=alpha.substring(ltr,ltr+1)+' " onclick="';
     document.write(a+'letter(this);"></tt></td>'); ltr++; };
     document.write("</tr>"); };
  var rnd=Math.floor(Math.random()*words.length);
  document.hang.word.value=words[rnd].toUpperCase();
  document.write('<tr><td colspan=13 align="center"><tt><font size=+2>');
    for (i=0;i<words[rnd].length;i++)
     { a=words[rnd].substring(i,i+1);
     if (alpha.indexOf(a,0)>-1) { a="*"; ltc++; };
       document.write('<input type="button" value="'+a+'">'); };
    document.write('</font></tt></td></tr>');
function letter(l)
{
   a=l.value.substring(1,2); l.value=" "; dh=document.hang;
   if (a!=" ")
   { w=dh.word.value;
     b=w.indexOf(a,0); f=1; dhl=dh.left;
     while (b>-1)
     { dh.elements[b+27].value=a;
     b=w.indexOf(a,b+1); f=0; ltc--; };
     dhl.value-=f;
     if (dhl.value==0)
     for (j=0;j<26;j++)
      dh.elements[j+1].click();
     }; };
function count()
{
   dh=document.hang; dhc=dh.clock; dhl=dh.left;
   dhc.value-=1; v=dhl.value*ltc*dhc.value
   if (v>0)
    setTimeout("count();",1000);
   else
   { msg="Congratulations!";
    if (dhl.value<0)
    msg="You Have No More Tries!";
    if (ltc>0)
    msg="Time Out! Answer: "+dh.word.value;
    dhl.value="0";
    alert(msg);
    }; };
</script>
<tr><td align="center" colspan=5>TURNS LEFT:<input type="button" value="10" name="left"></td>
<td colspan=5 align="center">TIME REMAINING:<input type="button" value="60" name="clock"></td>
<td colspan=3 align="center"><input type="button" value="Again" onclick="location='hangman.html';">
</td></form></tr></table>
En línea
Páginas: 1   Ir Arriba
  Imprimir  
 
Ir a:  

Mas buscadas: apuntes audio belleza bolsa cancer carpet carrera casas computadora credito cross curso informatica divx dolar drivers e mule economia explorer grafica hardware higiene industria industrial informatica internet libros linux mantenimiento manuales media medicina nutricion online paginas web politica posicionamiento programacion red red alert salud seguro seo software tecnologia trucos windows universidad venta video web windows winrar

UseBB Port by Gaia Modified & Upgraded by Croco Articulos PHP | Impulsado por SMF 1.1.6.
© 2005, Simple Machines LLC. Todos los Derechos Reservados.

Página creada en 0.093 segundos con 19 consultas.