2iia - Formations
2iia Menu Avion
2iia / FORMATION EN LIGNE
2iia Menu Avion
2iia / FORMATION EN LIGNE

Pierre, Feuille, Ciseaux

Testez vos compétences dans ce jeu classique

Choix disponibles :

Faites votre choix :

Code à copier :

<?php
session_start();
if (!isset($_SESSION['player_score'])) {
    $_SESSION['player_score'] = 0;
    $_SESSION['computer_score'] = 0;
}
?>
<!DOCTYPE html>
<html lang="fr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Jouez à Pierre, Feuille, Ciseaux avec notre jeu PHP interactif chez 2iia.">
    <meta name="keywords" content="pierre feuille ciseaux, jeu php, programmation, 2iia, interactif">
    <meta name="robots" content="index, follow">
    <meta name="organization" content="2iia">
    <meta name="address" content="11 rue Daguerre, Paris, 75014, Île-de-France, France">
    <meta name="region" content="Île-de-France">
    <meta name="google-site-verification" content="DV6tpAHrvGRSKhf5o3r61pYAJRxRl4hVbe9nKgSGaJE">
    <title>Pierre, Feuille, Ciseaux | 2iia</title>
    <link rel="canonical" href="https://www.2iia.com/pierre-feuille-ciseaux.php">
    <link rel="icon" href="img/favicon.ico" type="image/ico">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="manifest" href="/site.webmanifest">
    <meta property="og:title" content="Pierre, Feuille, Ciseaux | 2iia">
    <meta property="og:description" content="Jouez à Pierre, Feuille, Ciseaux avec notre jeu PHP interactif chez 2iia.">
    <meta property="og:image" content="https://www.2iia.com/img/2iia.jpg">
    <meta property="og:url" content="https://www.2iia.com/pierre-feuille-ciseaux.php">
    <meta property="og:type" content="website">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="Pierre, Feuille, Ciseaux | 2iia">
    <meta name="twitter:description" content="Testez vos compétences avec notre jeu Pierre, Feuille, Ciseaux chez 2iia.">
    <meta name="twitter:image" content="https://www.2iia.com/img/2iia.jpg">
    <script>
        (function(w, d, s, l, i) {
            w[l] = w[l] || [];
            w[l].push({
                'gtm.start': new Date().getTime(),
                event: 'gtm.js'
            });
            var f = d.getElementsByTagName(s)[0],
                j = d.createElement(s),
                dl = l != 'dataLayer' ? '&l=' + l : '';
            j.async = true;
            j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-55SP3RLD');
    </script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/icofont.css">
    <link rel="stylesheet" href="style.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js"></script>
    <script src="script.js" defer></script>
    <script type="application/ld+json">
        {
            "@context": "http://schema.org",
            "@type": "Organization",
            "name": "2iia",
            "url": "https://www.2iia.com",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "11 rue Daguerre",
                "addressLocality": "Paris",
                "postalCode": "75014",
                "addressRegion": "Île-de-France",
                "addressCountry": "France"
            },
            "contactPoint": {
                "@type": "ContactPoint",
                "email": "rolanddehghank@yahoo.com",
                "telephone": "+33-7-80-89-36-89",
                "contactType": "service client"
            }
        }
    </script>
    <style>
        .vegetation-list a {
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            font-weight: 500;
            color: #00aaff;
            text-decoration: none;
            padding: 2px 4px;
            border-radius: 3px;
            transition: color 0.3s ease, background-color 0.3s ease;
        }

        .vegetation-list a:hover {
            color: #ffffff;
            background-color: #1a3c5a;
            text-decoration: none;
        }

        .vegetation-list .losange {
            display: inline-block;
            width: 8px;
            height: 8px;
            background-color: #00aaff;
            transform: rotate(45deg);
            margin-right: 10px;
        }

        a.elegant-button,
        button.elegant-button {
            display: inline-block;
            padding: 12px 24px;
            background-color: #00aaff;
            color: #ffffff;
            font-family: 'Inter', sans-serif;
            font-size: 1.1rem;
            font-weight: 600;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s ease, transform 0.2s ease;
            border: none;
            cursor: pointer;
        }

        a.elegant-button:hover,
        button.elegant-button:hover {
            background-color: #0088cc;
            transform: translateY(-2px);
            text-decoration: none;
        }

        .vegetation-list {
            list-style: none;
            padding-left: 0;
            margin: 1rem 0;
        }

        .vegetation-list li {
            margin-bottom: 0.75rem;
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            color: #ffffff;
        }

        .vegetation-container {
            padding: clamp(15px, 2vw, 20px);
            border-radius: 12px;
            width: 90%;
            max-width: 420px;
            margin: 6rem auto 2rem;
            transition: transform 0.2s ease;
        }

        .vegetation-container:hover {
            transform: translateY(-2px);
        }

        select {
            width: 100%;
            padding: 0.8rem;
            margin-bottom: 1rem;
            border: none;
            border-radius: 5px;
            background-color: #1a3c5a;
            color: #ffffff;
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            transition: background-color 0.3s ease;
        }

        select:focus {
            outline: none;
            background-color: #2d5a7a;
            box-shadow: 0 0 0 2px #00aaff;
        }

        label {
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            font-weight: 500;
            color: #ffffff;
            margin-bottom: 0.5rem;
            display: block;
        }

        p {
            margin: 1rem 0;
            font-family: 'Inter', sans-serif;
            font-size: 1.1rem;
            color: #ffffff;
        }

        pre {
            background-color: #1a3c5a;
            padding: 1rem;
            border-radius: 5px;
            border: 1px solid #2d5a7a;
            text-align: left;
            max-height: 200px;
            overflow-y: auto;
            margin: 1rem 0;
            scrollbar-color: #00aaff #1a3c5a;
        }

        code {
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            color: #e0e0e0 !important;
        }
    </style>
</head>

<body class="dark-theme">
    <noscript>
        <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-55SP3RLD" height="0" width="0" style="display:none;visibility:hidden"></iframe>
    </noscript>
    <?php include 'templates/header.php'; ?>
    <?php include 'templates/menu.php'; ?>
    <div class="vegetation-container">
        <div class="vegetation-content">
            <h1 class="vegetation-subtitle">Pierre, Feuille, Ciseaux</h1>
            <h2 class="vegetation-subtitle">Testez vos compétences dans ce jeu classique</h2>
            <h2 class="vegetation-subtitle">Choix disponibles :</h2>
            <ul class="vegetation-list">
                <li><span class="losange"></span> Pierre</li>
                <li><span class="losange"></span> Feuille</li>
                <li><span class="losange"></span> Ciseaux</li>
            </ul>
            <h2 class="vegetation-subtitle">Faites votre choix :</h2>
            <form method="POST" action="">
                <label>Choisissez :</label>
                <select name="choice" required>
                    <option value="pierre">Pierre</option>
                    <option value="feuille">Feuille</option>
                    <option value="ciseaux">Ciseaux</option>
                </select>
                <button type="submit" class="elegant-button">Jouer</button>
            </form>
            <?php
            if ($_SERVER["REQUEST_METHOD"] == "POST") {
                $choices = ["pierre", "feuille", "ciseaux"];
                $player_choice = $_POST["choice"];
                $computer_choice = $choices[array_rand($choices)];
                if ($player_choice == $computer_choice) {
                    $result = "Égalité !";
                } elseif (
                    ($player_choice == "pierre" && $computer_choice == "ciseaux") ||
                    ($player_choice == "feuille" && $computer_choice == "pierre") ||
                    ($player_choice == "ciseaux" && $computer_choice == "feuille")
                ) {
                    $result = "Vous gagnez !";
                    $_SESSION['player_score']++;
                } else {
                    $result = "L'ordinateur gagne !";
                    $_SESSION['computer_score']++;
                }
                echo "<h2 class='vegetation-subtitle'>Résultat :</h2>";
                echo "<p>Vous : $player_choice | Ordinateur : $computer_choice</p>";
                echo "<p>$result</p>";
                echo "<p>Score - Vous : {$_SESSION['player_score']} | Ordinateur : {$_SESSION['computer_score']}</p>";
            }
            ?>
            <h2 class="vegetation-subtitle">Code à copier :</h2>
            <pre><code id="code-to-copy"><?php echo htmlspecialchars(file_get_contents(__FILE__)); ?></code></pre>
            <button onclick="copyCode()" class="elegant-button">Copier le code</button>
            <button onclick="window.location.href='https://2iia.com/contactez-nous.php'" class="elegant-button" aria-label="Nous contacter">Nous contacter</button>
        </div>
        <div class="cta-container">
            <div class="cta-block"></div>
        </div>
    </div>
    <div class="spacer-flash"></div>
    <?php include 'templates/footer.php'; ?>
    <script>
        function copyCode() {
            var code = document.getElementById("code-to-copy").innerText;
            navigator.clipboard.writeText(code);
            alert("Code copié !");
        }
    </script>
</body>

</html>
Footer