Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/12/2013, 12:06
ElleLawliet
 
Fecha de Ingreso: noviembre-2013
Mensajes: 47
Antigüedad: 10 años, 5 meses
Puntos: 0
Respuesta: Funcion alfil

Basandome en lo que has dicho e arreglado el codigo de la siguiente manera:

Código:
<!DOCTYPE html>
<head>
  <meta  charset="utf-8" />
  <title></title>
  <script>
  	function movimientoAlfil(f1, f2, c1, c2)
	{
	    return (Math.abs(f2-f1)==Math.abs(c2-c1));
	}
  </script>
</head>
<body>

<script>

	alert(movimientoAlfil(2,2,4,3));
	
</script>

</body>
</html>
Ahora si que muestra resultado. Pero no se como hacer para que funcione en todos los casos