コード例 #1
0
ファイル: turn.php プロジェクト: aymericbouzy/cluedo-solver
<?php

echo form_input(pretty_card(array("id" => get_current_player())) . " suspecte", "suspect", $form, array("options" => option_array(select_suspects(), "id", "name", "card")));
echo form_input("avec l'arme", "weapon", $form, array("options" => option_array(select_weapons(), "id", "name", "card")));
echo form_input("dans la pièce", "room", $form, array("options" => option_array(select_rooms(), "id", "name", "card")));
echo form_input("mais le témoin", "witness", $form, array("options" => array_true_merge(option_array(select_players(), "id", "name", "card"), array(0 => ""))));
if (get_current_player() == my_player()) {
    echo form_input("réfute avec", "evidence", $form, array("options" => option_array(select_types(), "id", "name", "type")));
} else {
    echo "réfute";
}
?>
.
<br>
<?php 
$turns = select_turns();
echo form_submit_button("Ok") . " " . link_to(path("skip", "game", game), "Suivant", array("class" => "btn btn-primary")) . " " . (!is_empty($turns) ? link_to(path("revert", "game", game), "Annuler le dernier coup", array("class" => "btn btn-primary")) : "");
コード例 #2
0
ファイル: show.php プロジェクト: aymericbouzy/cluedo-solver
<h1>Armes</h1>
<table class="table table-bordered table-hover table-small-char">
  <thead>
    <tr>
      <th></th>
      <?php 
foreach (select_players() as $player) {
    echo "<th>" . pretty_card($player) . "</th>";
}
?>
    </tr>
  </thead>
  <tbody>
    <?php 
foreach (select_weapons() as $weapon) {
    ?>
      <tr>
        <td><?php 
    echo pretty_card($weapon);
    ?>
</td>
        <?php 
    foreach (select_players() as $player) {
        $class = "status-" . $status_to_class[get_status($weapon["id"], $player["id"])];
        ?>
          <td class="<?php 
        echo $class;
        ?>
"></td>
          <?php