problema de impresión de PHP

  • jamesbond
  • Novice
  • Novice
  • No Avatar
  • Registrado: Ago 22, 2011
  • Mensajes: 19
  • Status: Offline

Nota Octubre 15th, 2011, 2:01 am

Im tring para hacer un programa de póquer simple php y las tarjetas están etiquetados 2d.gif 3d.gif y así sucesivamente (diamantes 2 diamantes 3)
y tenerlos ordenados en dos matrices y uno para tarjetas y otro para trajes pero im teniendo hacen problemas que les imprimir
Código: [ Select ]
<body>
<h1>Poker Tourment</h1>
<br>
</center>
<?php
$cards = array('a','1','3','4','5','6','7','8','9','10','j','q','k');
$suits = array('c','d','h','s');
$rand_keys = array_rand($cards,2);
$rand_keys = array_rand($suits,2);
for($i=0;i<=5;$i++){
print "<img src =\"$cards$suits.gif\" alt = \"$cards$suits.gif\"/>"; 
}
?>
<button type = "submit">Deal</button><br>
<a href="poker.php">Play again</a>
</body>
  1. <body>
  2. <h1>Poker Tourment</h1>
  3. <br>
  4. </center>
  5. <?php
  6. $cards = array('a','1','3','4','5','6','7','8','9','10','j','q','k');
  7. $suits = array('c','d','h','s');
  8. $rand_keys = array_rand($cards,2);
  9. $rand_keys = array_rand($suits,2);
  10. for($i=0;i<=5;$i++){
  11. print "<img src =\"$cards$suits.gif\" alt = \"$cards$suits.gif\"/>"; 
  12. }
  13. ?>
  14. <button type = "submit">Deal</button><br>
  15. <a href="poker.php">Play again</a>
  16. </body>


Im tring justa para que hacer 5 tarjetas al azar por ahora
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 15th, 2011, 2:01 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Octubre 15th, 2011, 9:43 am

La matriz de un solo 52 elemento utilizaría para una baraja. Entonces al azar puntea tarjetas desde esa cubierta mediante empalme, División/lcg_value y agregarlos a una matriz de manos.
Strong with this one, the sudo is.
  • jamesbond
  • Novice
  • Novice
  • No Avatar
  • Registrado: Ago 22, 2011
  • Mensajes: 19
  • Status: Offline

Nota Octubre 15th, 2011, 11:54 pm

¿Cómo se consigue el bucle imprimir en una sola línea de izquierda a derecha?
  • jamesbond
  • Novice
  • Novice
  • No Avatar
  • Registrado: Ago 22, 2011
  • Mensajes: 19
  • Status: Offline

Nota Octubre 17th, 2011, 2:26 pm

puede cerrar esto averiguado (utiliza una div css)

Publicar Información

  • Total de mensajes en este tema: 4 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 139 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC