Yolanda Martinez Mejia

All generations.

generate functionTue, 18 Apr 2023

codigo en phython para un juego de ajedrez con dos participantes

def drake_chess(p1, p2): p1_score = 0 p2_score = 0 for i in range(4): p1_win = randint(0,1) if p1_win == 1: p1_score += 1 print('Game {game}: {player1} wins!'.format(game=i, player1=p1)) else: p2_score += 1 print('Game {game}: {player2} wins!'.format(game=i, player2=p2)) if p1_score > p2_score: print('{player1} is the overall winner!'.format(player1=p1)) elif p2_score > p1_score: print('{player2} is the overall winner!'.format(player2=p2)) else: print('The series is tied!') drake_chess('Bobby Fischer', 'Garry Kasparov')

Python
View
generate functionSat, 15 Apr 2023

tabla de ajedrez

<?php function tablaAjedrez($ancho=8, $alto=8) { $tablero = ""; for ($x=1; $x<=$alto; $x++) { for ($y=1; $y<=$ancho; $y++) { $color = $x%2 == $y%2 ? "white" : "black"; $tablero .= "<div class=\"square $color\">$x,$y</div>"; } } echo "<div class=\"chessboard\">$tablero</div>"; } tablaAjedrez(5,5); ?>

PHP
View
generate functionMon, 17 Apr 2023

formulario de 10 x 10 que sume los numeros con una tabla de color verde

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } </style> </head> <body> <table style="width:100%"> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> </tr> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table> </body>

PHP
View
generate functionMon, 17 Apr 2023

formulario y tabla de ajedrez que sea de color negro y los margenes de 5cm

{!! Form::open(['route' => 'posts.store']) !!} <div class="form-group"> {!! Form::label('title', 'Titulo:') !!} {!! Form::text('title', null, ['class' => 'form-control']) !!} </div> <div class="form-group"> {!! Form::submit('Create Post', ['class' => 'btn btn-primary']) !!} </div> {!! Form::close() !!} <style> table{ background-color: black; margin: 5cm; } </style>

PHP
View

Questions about programming?Chat with your personal AI assistant