<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tools on MC Chung</title>
    <link>https://example.com/tools/</link>
    <description>Recent content in Tools on MC Chung</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 05 Nov 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://example.com/tools/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rock, Paper, Scissors Simulation</title>
      <link>https://example.com/tools/rpsgame/</link>
      <pubDate>Wed, 05 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://example.com/tools/rpsgame/</guid>
      <description>&lt;style&gt;&#xD;&#xA;    .game-description {&#xD;&#xA;        margin-bottom: 20px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .game-container {&#xD;&#xA;        max-width: 800px;&#xD;&#xA;        margin: 0 auto;&#xD;&#xA;        padding: 20px;&#xD;&#xA;        border: 2px solid #666;&#xD;&#xA;        border-radius: 10px;&#xD;&#xA;        background-color: transparent;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .parameters-title {&#xD;&#xA;        font-size: 20px;&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        margin-bottom: 25px;&#xD;&#xA;        color: white;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .input-section {&#xD;&#xA;        display: flex;&#xD;&#xA;        flex-direction: column;&#xD;&#xA;        gap: 15px;&#xD;&#xA;        margin-bottom: 20px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .top-row {&#xD;&#xA;        display: flex;&#xD;&#xA;        gap: 15px;&#xD;&#xA;        justify-content: space-between;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .input-group {&#xD;&#xA;        display: flex;&#xD;&#xA;        align-items: center;&#xD;&#xA;        gap: 8px;&#xD;&#xA;        margin-bottom: 10px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .input-group label {&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        color: white;&#xD;&#xA;        white-space: nowrap;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .input-group input {&#xD;&#xA;        padding: 8px;&#xD;&#xA;        border: 1px solid #666;&#xD;&#xA;        border-radius: 4px;&#xD;&#xA;        font-size: 14px;&#xD;&#xA;        width: 60px;&#xD;&#xA;        background-color: transparent;&#xD;&#xA;        color: white;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #startButton {&#xD;&#xA;        padding: 12px 24px;&#xD;&#xA;        background-color: #4CAF50;&#xD;&#xA;        color: white;&#xD;&#xA;        border: none;&#xD;&#xA;        border-radius: 5px;&#xD;&#xA;        font-size: 16px;&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        cursor: pointer;&#xD;&#xA;        transition: background-color 0.3s;&#xD;&#xA;        margin-left: 20px;&#xD;&#xA;        margin-bottom: 10px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #startButton:hover {&#xD;&#xA;        background-color: #0056b3;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #startButton:disabled {&#xD;&#xA;        background-color: #6c757d;&#xD;&#xA;        cursor: not-allowed;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #simulationResults {&#xD;&#xA;        margin-top: 30px;&#xD;&#xA;        background-color: white;&#xD;&#xA;        border: 2px solid #666;&#xD;&#xA;        border-radius: 10px;&#xD;&#xA;        height: 400px;&#xD;&#xA;        position: relative;&#xD;&#xA;        overflow: hidden;&#xD;&#xA;        display: none;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #gameCanvas {&#xD;&#xA;        width: 100%;&#xD;&#xA;        height: 100%;&#xD;&#xA;        display: block;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #countdown {&#xD;&#xA;        position: absolute;&#xD;&#xA;        top: 0;&#xD;&#xA;        left: 0;&#xD;&#xA;        width: 100%;&#xD;&#xA;        height: 100%;&#xD;&#xA;        display: flex;&#xD;&#xA;        align-items: center;&#xD;&#xA;        justify-content: center;&#xD;&#xA;        font-size: 120px;&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        color: #333;&#xD;&#xA;        z-index: 1000;&#xD;&#xA;        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);&#xD;&#xA;        background-color: white;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .rps-item {&#xD;&#xA;        position: absolute;&#xD;&#xA;        width: 40px;&#xD;&#xA;        height: 40px;&#xD;&#xA;        pointer-events: none;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #progressBar {&#xD;&#xA;        position: absolute;&#xD;&#xA;        bottom: 10px;&#xD;&#xA;        left: 10px;&#xD;&#xA;        right: 10px;&#xD;&#xA;        background-color: rgba(102, 102, 102, 0.8);&#xD;&#xA;        border-radius: 8px;&#xD;&#xA;        height: 8px;&#xD;&#xA;        overflow: hidden;&#xD;&#xA;        display: none;&#xD;&#xA;        /* border: 1px solid rgba(51, 51, 51, 0.8); */&#xD;&#xA;        z-index: 500;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #progressFill {&#xD;&#xA;        height: 100%;&#xD;&#xA;        width: 0%;&#xD;&#xA;        background: linear-gradient(90deg, #007bff, #0056b3, #004085);&#xD;&#xA;        transition: width 0.1s ease;&#xD;&#xA;        border-radius: 6px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    #simulationSummary {&#xD;&#xA;        margin-top: 10px;&#xD;&#xA;        background-color: white;&#xD;&#xA;        border: 2px solid #666;&#xD;&#xA;        border-radius: 10px;&#xD;&#xA;        padding: 20px;&#xD;&#xA;        display: none;&#xD;&#xA;        color: #333;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .summary-title {&#xD;&#xA;        font-size: 18px;&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        margin-bottom: 15px;&#xD;&#xA;        text-align: center;&#xD;&#xA;        color: #333;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .summary-results {&#xD;&#xA;        display: grid;&#xD;&#xA;        grid-template-columns: repeat(3, 1fr);&#xD;&#xA;        gap: 15px;&#xD;&#xA;        text-align: center;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .result-item {&#xD;&#xA;        padding: 10px;&#xD;&#xA;        border-radius: 8px;&#xD;&#xA;        background-color: #f8f9fa;&#xD;&#xA;        border: 1px solid #dee2e6;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .result-item .type {&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        font-size: 16px;&#xD;&#xA;        margin-bottom: 5px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .result-item .count {&#xD;&#xA;        font-size: 24px;&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        color: #007bff;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    @media (max-width: 600px) {&#xD;&#xA;        #countdown {&#xD;&#xA;            font-size: 80px;&#xD;&#xA;        }&#xD;&#xA;&#xD;&#xA;        .rps-item {&#xD;&#xA;            width: 30px;&#xD;&#xA;            height: 30px;&#xD;&#xA;        }&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    @media (max-width: 600px) {&#xD;&#xA;        .top-row {&#xD;&#xA;            flex-direction: column;&#xD;&#xA;            align-items: center;&#xD;&#xA;            gap: 10px;&#xD;&#xA;        }&#xD;&#xA;&#xD;&#xA;        .bottom-row {&#xD;&#xA;            flex-direction: column;&#xD;&#xA;            align-items: flex-start;&#xD;&#xA;            gap: 10px;&#xD;&#xA;        }&#xD;&#xA;&#xD;&#xA;        #startButton {&#xD;&#xA;            margin-left: 0;&#xD;&#xA;        }&#xD;&#xA;    }&#xD;&#xA;&lt;/style&gt;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&lt;div class=&#34;game-description&#34;&gt;&#xD;&#xA;    &lt;p&gt;Set the quantity of each option and simulation time to observe the distribution of battle results.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Heads or tails?</title>
      <link>https://example.com/tools/unfaircoin/</link>
      <pubDate>Tue, 30 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://example.com/tools/unfaircoin/</guid>
      <description>&lt;style&gt;&#xD;&#xA;    .game-container {&#xD;&#xA;        text-align: center;&#xD;&#xA;        padding: 20px;&#xD;&#xA;        max-width: 600px;&#xD;&#xA;        margin: 0 auto;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .coin-container {&#xD;&#xA;        margin: 40px 0;&#xD;&#xA;        perspective: 1000px;&#xD;&#xA;        height: 200px;&#xD;&#xA;        display: flex;&#xD;&#xA;        justify-content: center;&#xD;&#xA;        align-items: center;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .coin {&#xD;&#xA;        width: 150px;&#xD;&#xA;        height: 150px;&#xD;&#xA;        position: relative;&#xD;&#xA;        transform-style: preserve-3d;&#xD;&#xA;        transition: transform ease-out;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .coin-face {&#xD;&#xA;        position: absolute;&#xD;&#xA;        width: 100%;&#xD;&#xA;        height: 100%;&#xD;&#xA;        backface-visibility: hidden;&#xD;&#xA;        border-radius: 50%;&#xD;&#xA;        overflow: hidden;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .coin-face img {&#xD;&#xA;        width: 100%;&#xD;&#xA;        height: 100%;&#xD;&#xA;        object-fit: cover;&#xD;&#xA;        border-radius: 50%;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .coin-heads {&#xD;&#xA;        transform: rotateY(0deg);&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .coin-tails {&#xD;&#xA;        transform: rotateY(180deg);&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .flip-animation {&#xD;&#xA;        animation: flip ease-out;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    @keyframes flip {&#xD;&#xA;        0% { transform: rotateY(0deg); }&#xD;&#xA;        100% { transform: rotateY(1800deg); }&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .game-button {&#xD;&#xA;        background-color: #4CAF50;&#xD;&#xA;        border: none;&#xD;&#xA;        color: white;&#xD;&#xA;        padding: 15px 32px;&#xD;&#xA;        text-align: center;&#xD;&#xA;        text-decoration: none;&#xD;&#xA;        display: inline-block;&#xD;&#xA;        font-size: 16px;&#xD;&#xA;        font-weight: bold;&#xD;&#xA;        margin: 4px 2px;&#xD;&#xA;        cursor: pointer;&#xD;&#xA;        border-radius: 4px;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .game-button:disabled {&#xD;&#xA;        background-color: #cccccc;&#xD;&#xA;        cursor: not-allowed;&#xD;&#xA;    }&#xD;&#xA;&lt;/style&gt;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&lt;div&gt;&#xD;&#xA;    Press start to flip the coin.&#xD;&#xA;    &lt;ul&gt;&#xD;&#xA;        &lt;li&gt; If it lands heads up, you give me 10 dollars.&lt;/li&gt;&#xD;&#xA;        &lt;li&gt; If it lands tails up, I will give you 10 dollars.&lt;/li&gt;&#xD;&#xA;    &lt;/ul&gt;&#xD;&#xA;&lt;/div&gt;&#xD;&#xA;&#xD;&#xA;&lt;div class=&#34;game-container&#34;&gt;&#xD;&#xA;&#xD;&#xA;    &lt;div class=&#34;coin-container&#34;&gt;&#xD;&#xA;        &lt;div id=&#34;coin&#34; class=&#34;coin&#34;&gt;&#xD;&#xA;            &lt;div class=&#34;coin-face coin-heads&#34;&gt;&#xD;&#xA;                &lt;img src=&#34;https://example.com/images/coin-head.png&#34; width=&#34;150&#34; height=&#34;150&#34; alt=&#34;Coin Head&#34;&gt;&#xD;&#xA;            &lt;/div&gt;&#xD;&#xA;            &lt;div class=&#34;coin-face coin-tails&#34;&gt;&#xD;&#xA;                &lt;img src=&#34;https://example.com/images/coin-tail.png&#34; width=&#34;150&#34; height=&#34;150&#34; alt=&#34;Coin Tail&#34;&gt;&#xD;&#xA;            &lt;/div&gt;&#xD;&#xA;        &lt;/div&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;&#xD;&#xA;    &lt;button id=&#34;flipButton&#34; class=&#34;game-button&#34; onclick=&#34;flipCoin()&#34;&gt;Start&lt;/button&gt;&#xD;&#xA;&#xD;&#xA;&lt;/div&gt;&#xD;&#xA;&#xD;&#xA;&lt;script&gt;&#xD;&#xA;    let isFlipping = false;&#xD;&#xA;&#xD;&#xA;    function flipCoin() {&#xD;&#xA;        if (isFlipping) return;&#xD;&#xA;        &#xD;&#xA;        isFlipping = true;&#xD;&#xA;        const flipButton = document.getElementById(&#39;flipButton&#39;);&#xD;&#xA;        const coin = document.getElementById(&#39;coin&#39;);&#xD;&#xA;        &#xD;&#xA;        flipButton.disabled = true;&#xD;&#xA;        flipButton.textContent = &#39;Flipping...&#39;;&#xD;&#xA;        &#xD;&#xA;        // 隨機翻轉時間 3-7 秒&#xD;&#xA;        const flipDuration = Math.random() * 4000 + 3000; // 3000-7000ms&#xD;&#xA;        &#xD;&#xA;        // 決定結果 (90% 正面, 10% 背面)&#xD;&#xA;        const isHeads = Math.random() &lt; 0.9;&#xD;&#xA;        &#xD;&#xA;        // 計算最終角度&#xD;&#xA;        const baseRotations = 5; // 基本翻轉次數&#xD;&#xA;        const extraRotations = Math.floor(Math.random() * 3); // 額外 0-2 次翻轉&#xD;&#xA;        const totalRotations = baseRotations + extraRotations;&#xD;&#xA;        const finalAngle = isHeads ? totalRotations * 360 : totalRotations * 360 + 180;&#xD;&#xA;        &#xD;&#xA;        // 應用動畫&#xD;&#xA;        coin.style.animationDuration = flipDuration + &#39;ms&#39;;&#xD;&#xA;        coin.style.transform = `rotateY(${finalAngle}deg)`;&#xD;&#xA;        coin.classList.add(&#39;flip-animation&#39;);&#xD;&#xA;        &#xD;&#xA;        setTimeout(() =&gt; {&#xD;&#xA;            coin.classList.remove(&#39;flip-animation&#39;);&#xD;&#xA;            &#xD;&#xA;            flipButton.disabled = false;&#xD;&#xA;            flipButton.textContent = &#39;Start&#39;;&#xD;&#xA;            isFlipping = false;&#xD;&#xA;        }, flipDuration);&#xD;&#xA;    }&#xD;&#xA;&lt;/script&gt;</description>
    </item>
    <item>
      <title>Monty Hall Problem</title>
      <link>https://example.com/tools/montyhall/</link>
      <pubDate>Wed, 10 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://example.com/tools/montyhall/</guid>
      <description>&lt;style&gt;&#xD;&#xA;    .grid-wapper {&#xD;&#xA;        display: grid;&#xD;&#xA;        grid-template-columns: 1fr 1fr 1fr;&#xD;&#xA;        background-color: lightgray;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .grid-wapper1 {&#xD;&#xA;        display: grid;&#xD;&#xA;        grid-template-columns: 1fr;&#xD;&#xA;        text-align: center;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    .center {&#xD;&#xA;        display: flex;&#xD;&#xA;        justify-self: center;&#xD;&#xA;        align-content: center;&#xD;&#xA;    }&#xD;&#xA;&lt;/style&gt;&#xD;&#xA;&#xD;&#xA;&lt;div&gt;&#xD;&#xA;    Suppose you&#39;re on a game show, and you&#39;re given the choice of three doors: Behind one door is a car; behind the&#xD;&#xA;    others, goats. You pick a door, say No. 1, and the host, who knows what&#39;s behind the doors, opens another door, say&#xD;&#xA;    No. 3, which has a goat. He then says to you, &#34;Do you want to pick door No. 2?&#34;&#xD;&#xA;    Is it to your advantage to switch your choice?&#xD;&#xA;&lt;/div&gt;&#xD;&#xA;&lt;div class=&#34;grid-wapper&#34; style=&#34;margin-top: 20px;&#34;&gt;&#xD;&#xA;    &lt;div class=&#34;grid-wapper1&#34;&gt;&#xD;&#xA;        &lt;div class=&#34;center&#34; style=&#34;margin-top: 20px;&#34;&gt;&lt;img id=&#34;doorImg1&#34; src=&#34;https://example.com/images/door.svg&#34; /&gt;&lt;/div&gt;&#xD;&#xA;        &lt;div style=&#34;margin-bottom: 10px;&#34;&gt;&lt;input type=&#34;radio&#34; id=&#34;door1&#34; value=&#34;door1&#34; name=&#34;chooseDoor&#34; /&gt;&lt;/div&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;    &lt;div class=&#34;grid-wapper1&#34;&gt;&#xD;&#xA;        &lt;div class=&#34;center&#34; style=&#34;margin-top: 20px;&#34;&gt;&lt;img id=&#34;doorImg2&#34; src=&#34;https://example.com/images/door.svg&#34; /&gt;&lt;/div&gt;&#xD;&#xA;        &lt;div style=&#34;margin-bottom: 10px;&#34;&gt;&lt;input type=&#34;radio&#34; id=&#34;door2&#34; value=&#34;door2&#34; name=&#34;chooseDoor&#34; /&gt;&lt;/div&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;    &lt;div class=&#34;grid-wapper1&#34;&gt;&#xD;&#xA;        &lt;div class=&#34;center&#34; style=&#34;margin-top: 20px;&#34;&gt;&lt;img id=&#34;doorImg3&#34; src=&#34;https://example.com/images/door.svg&#34; /&gt;&lt;/div&gt;&#xD;&#xA;        &lt;div style=&#34;margin-bottom: 10px;&#34;&gt;&lt;input type=&#34;radio&#34; id=&#34;door3&#34; value=&#34;door3&#34; name=&#34;chooseDoor&#34; /&gt;&lt;/div&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;&lt;/div&gt;&#xD;&#xA;&lt;div style=&#34;text-align: center; margin-top: 10px;&#34;&gt;&#xD;&#xA;    &lt;button type=&#34;button&#34; id=&#34;checkBtn&#34; onclick=&#34;showOneDoor()&#34;&gt;Check&lt;/button&gt;&#xD;&#xA;    &lt;button type=&#34;button&#34; id=&#34;changeBtn&#34; style=&#34;display: none;&#34; onclick=&#34;showResult(this.id)&#34;&gt;Change&lt;/button&gt;&#xD;&#xA;    &lt;button type=&#34;button&#34; id=&#34;notChangeBtn&#34; style=&#34;display: none; margin-left: 10px;&#34; onclick=&#34;showResult(this.id)&#34;&gt;Not Change&lt;/button&gt;&#xD;&#xA;    &lt;button type=&#34;button&#34; id=&#34;restartBtn&#34; style=&#34;display: none;&#34; onclick=&#34;location.reload()&#34;&gt;Restart&lt;/button&gt;&#xD;&#xA;&lt;/div&gt;&#xD;&#xA;&#xD;&#xA;&lt;script&gt;&#xD;&#xA;&#xD;&#xA;    var carDoor, chooseDoor, openGoatDoor, remainDoor;&#xD;&#xA;    function showOneDoor() {&#xD;&#xA;        try {&#xD;&#xA;            chooseDoor = parseInt(document.querySelector(&#39;input[name=&#34;chooseDoor&#34;]:checked&#39;).value[4]);&#xD;&#xA;            carDoor = Math.ceil(Math.random() * 3);&#xD;&#xA;            const doors = [1, 2, 3];&#xD;&#xA;&#xD;&#xA;            // openDoor(carDoor);&#xD;&#xA;            console.log(chooseDoor);&#xD;&#xA;            console.log(`door${carDoor}`);&#xD;&#xA;&#xD;&#xA;            if (`${chooseDoor}` === `door${carDoor}`) {&#xD;&#xA;                doors.splice(carDoor - 1, 1);&#xD;&#xA;                console.log(doors);&#xD;&#xA;&#xD;&#xA;                var openGoatDoorIndex = Math.ceil(Math.random() * 2);&#xD;&#xA;                openGoatDoor = doors[openGoatDoorIndex - 1];&#xD;&#xA;                doors.splice(openGoatDoorIndex - 1, 1);&#xD;&#xA;                remainDoor = doors[0];&#xD;&#xA;                openDoor(openGoatDoor);&#xD;&#xA;            } else {&#xD;&#xA;                openGoatDoor = doors.filter(x =&gt; x != carDoor &amp;&amp; x != chooseDoor)[0];&#xD;&#xA;                remainDoor = doors.filter(x =&gt; x != openGoatDoor &amp;&amp; x != chooseDoor)[0];&#xD;&#xA;                openDoor(openGoatDoor);&#xD;&#xA;            }&#xD;&#xA;&#xD;&#xA;            var checkBtn = document.getElementById(&#34;checkBtn&#34;);&#xD;&#xA;            var changeBtn = document.getElementById(&#34;changeBtn&#34;);&#xD;&#xA;            var notChangeBtn = document.getElementById(&#34;notChangeBtn&#34;);&#xD;&#xA;&#xD;&#xA;            checkBtn.style.display = &#39;none&#39;;&#xD;&#xA;            changeBtn.style.display = &#39;&#39;;&#xD;&#xA;            notChangeBtn.style.display = &#39;&#39;;&#xD;&#xA;        } catch (e) {&#xD;&#xA;            alert(&#34;Please choose a door!&#34;)&#xD;&#xA;        }&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    function openDoor(doorNumber) {&#xD;&#xA;        var doorImgElement = document.getElementById(`doorImg${doorNumber}`);&#xD;&#xA;        doorImgElement.src = &#34;/images/goat.svg&#34;;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    async function showResult(btnId) {&#xD;&#xA;        console.log(btnId)&#xD;&#xA;        var doorImgElement = document.getElementById(`doorImg${openGoatDoor}`);&#xD;&#xA;        doorImgElement.style.opacity = 0;&#xD;&#xA;&#xD;&#xA;        if (btnId == &#34;changeBtn&#34;) {&#xD;&#xA;            var doorRadioElement = document.getElementById(`door${remainDoor}`);&#xD;&#xA;            doorRadioElement.checked = true;&#xD;&#xA;&#xD;&#xA;            var temp = remainDoor;&#xD;&#xA;            remainDoor = chooseDoor;&#xD;&#xA;            chooseDoor = temp;&#xD;&#xA;        }&#xD;&#xA;&#xD;&#xA;        await new Promise(r =&gt; setTimeout(r, 500));&#xD;&#xA;&#xD;&#xA;        var doorImgElement = document.getElementById(`doorImg${chooseDoor}`);&#xD;&#xA;        if (carDoor == chooseDoor) {&#xD;&#xA;            doorImgElement.src = &#34;/images/car.svg&#34;;&#xD;&#xA;        } else {&#xD;&#xA;            doorImgElement.src = &#34;/images/goat.svg&#34;;&#xD;&#xA;        }&#xD;&#xA;&#xD;&#xA;        var restartBtn = document.getElementById(&#34;restartBtn&#34;);&#xD;&#xA;        var changeBtn = document.getElementById(&#34;changeBtn&#34;);&#xD;&#xA;        var notChangeBtn = document.getElementById(&#34;notChangeBtn&#34;);&#xD;&#xA;&#xD;&#xA;        restartBtn.style.display = &#39;&#39;;&#xD;&#xA;        changeBtn.style.display = &#39;none&#39;;&#xD;&#xA;        notChangeBtn.style.display = &#39;none&#39;;&#xD;&#xA;    }&#xD;&#xA;&lt;/script&gt;</description>
    </item>
    <item>
      <title>Arrange Seat</title>
      <link>https://example.com/tools/arrangeseat/</link>
      <pubDate>Sun, 11 Feb 2024 00:00:00 +0000</pubDate>
      <guid>https://example.com/tools/arrangeseat/</guid>
      <description>&lt;ul&gt;&#xD;&#xA;    &lt;li&gt;&#xD;&#xA;        Please upload the student list downloaded from NTU Cool directly.&#xD;&#xA;    &lt;/li&gt;&#xD;&#xA;&lt;/ul&gt;&lt;br&gt;&#xD;&#xA;&#xD;&#xA;&lt;form id=&#34;info&#34;&gt;&#xD;&#xA;    &lt;div&gt;&#xD;&#xA;        &lt;input type=&#34;file&#34; id=&#34;studentList&#34; accept=&#34;.xlsx, .csv&#34; required /&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;    &lt;div style=&#34;margin-top: 20px;&#34;&gt;&#xD;&#xA;        &lt;select name=&#34;classroom&#34; id=&#34;classroom&#34; required&gt;&#xD;&#xA;            &lt;option value=&#34;&#34; disabled selected=&#34;selected&#34;&gt;Choose your classroom&lt;/option&gt;&#xD;&#xA;        &lt;/select&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;    &lt;div style=&#34;margin-top: 20px;&#34;&gt;&#xD;&#xA;        &lt;select name=&#34;method&#34; id=&#34;method&#34; required&gt;&#xD;&#xA;            &lt;option value=&#34;&#34; disabled selected=&#34;selected&#34;&gt;Choose a method&lt;/option&gt;&#xD;&#xA;            &lt;option value=&#34;method1&#34;&gt;Method1&lt;/option&gt;&#xD;&#xA;            &lt;!-- &lt;option value=&#34;method2&#34;&gt;Method2&lt;/option&gt; --&gt;&#xD;&#xA;        &lt;/select&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;    &lt;div style=&#34;margin-top: 20px;&#34;&gt;&#xD;&#xA;        &lt;label for=&#34;seatTitle&#34;&gt;Title:&lt;/label&gt;&#xD;&#xA;        &lt;input type=&#34;text&#34; id=&#34;seatTitle&#34; placeholder=&#34;(optional)&#34; /&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;    &lt;div style=&#34;margin-top: 20px;&#34;&gt;&#xD;&#xA;        &lt;button type=&#34;submit&#34;&gt;Submit&lt;/button&gt;&#xD;&#xA;        &lt;button type=&#34;button&#34; id=&#34;printBtn&#34; style=&#34;display: none;&#34; onclick=&#34;printTable()&#34;&gt;Print&lt;/button&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;&#xD;&#xA;    &lt;div id=&#34;printElement&#34; style=&#34;display: none;&#34;&gt;&#xD;&#xA;        &lt;div class=&#34;seat&#34;&gt;&#xD;&#xA;            &lt;table id=&#34;table1&#34;&gt;&#xD;&#xA;            &lt;/table&gt;&#xD;&#xA;        &lt;/div&gt;&#xD;&#xA;    &lt;/div&gt;&#xD;&#xA;&lt;/form&gt;&#xD;&#xA;&lt;script src=&#34;https://example.com/js/arrangeSeat.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.3/xlsx.full.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.fonts.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.8.1/jspdf.plugin.autotable.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script&gt;&#xD;&#xA;    document.getElementById(&#39;info&#39;).addEventListener(&#39;submit&#39;, function (event) {&#xD;&#xA;        event.preventDefault()&#xD;&#xA;        submit()&#xD;&#xA;    });&#xD;&#xA;    addOptions();&#xD;&#xA;    var numberOfStudents = 0;&#xD;&#xA;&#xD;&#xA;    function submit() {&#xD;&#xA;        var studentList = document.getElementById(&#39;studentList&#39;).files[0]&#xD;&#xA;        var reader = new FileReader()&#xD;&#xA;&#xD;&#xA;        reader.onload = function (file) {&#xD;&#xA;            var data = new Uint8Array(file.target.result)&#xD;&#xA;            var workbook = XLSX.read(data, { type: &#39;array&#39; })&#xD;&#xA;            var sheet_name = workbook.SheetNames[0]&#xD;&#xA;            var sheet = workbook.Sheets[sheet_name]&#xD;&#xA;            jsonData = XLSX.utils.sheet_to_json(sheet, { header: 1 })&#xD;&#xA;            var studentNames = []&#xD;&#xA;            for (var i = 1; i &lt; jsonData.length; i++) {&#xD;&#xA;                studentNames.push(jsonData[i][4].split(&#34; (&#34;)[0])&#xD;&#xA;            }&#xD;&#xA;            dataProcess(studentNames)&#xD;&#xA;        }&#xD;&#xA;        reader.readAsArrayBuffer(studentList);&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    function dataProcess(studentNames) {&#xD;&#xA;        numberOfStudents = studentNames.length&#xD;&#xA;        var sampleNames = sample(studentNames, studentNames.length)&#xD;&#xA;        var classroom = getClassroom();&#xD;&#xA;&#xD;&#xA;        var result;&#xD;&#xA;        var method = document.getElementById(&#39;method&#39;).value;&#xD;&#xA;        switch (method) {&#xD;&#xA;            case &#39;method1&#39;:&#xD;&#xA;                result = method1(sampleNames, classroom)&#xD;&#xA;                break;&#xD;&#xA;            case &#39;method2&#39;:&#xD;&#xA;                result = method1(sampleNames, classroom)&#xD;&#xA;                break;&#xD;&#xA;            default:&#xD;&#xA;                break;&#xD;&#xA;        }&#xD;&#xA;&#xD;&#xA;        console.log(result)&#xD;&#xA;&#xD;&#xA;        createTable(result)&#xD;&#xA;&#xD;&#xA;        var printBtn = document.getElementById(&#39;printBtn&#39;);&#xD;&#xA;        printBtn.style.display = &#39;&#39;;&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;    function createTable(tableData) {&#xD;&#xA;        var table = document.getElementById(&#39;table1&#39;);&#xD;&#xA;        var tableBody = document.createElement(&#39;tbody&#39;);&#xD;&#xA;&#xD;&#xA;        tableData.forEach(function (rowData, rIndex) {&#xD;&#xA;            var row = document.createElement(&#39;tr&#39;);&#xD;&#xA;&#xD;&#xA;            rowData.forEach(function (cellData, cIndex) {&#xD;&#xA;                var cell = document.createElement(&#39;td&#39;);&#xD;&#xA;                if (cellData === &#34;AA&#34;)&#xD;&#xA;                    cell.classList.add(&#39;aisle&#39;);&#xD;&#xA;                if (rIndex == 0 || cIndex == 0)&#xD;&#xA;                    cell.classList.add(&#39;index&#39;);&#xD;&#xA;                cell.appendChild(document.createTextNode(cellData));&#xD;&#xA;                row.appendChild(cell);&#xD;&#xA;            });&#xD;&#xA;&#xD;&#xA;            tableBody.appendChild(row);&#xD;&#xA;        });&#xD;&#xA;&#xD;&#xA;        table.replaceChildren(tableBody);&#xD;&#xA;    }&#xD;&#xA;&#xD;&#xA;&lt;/script&gt;</description>
    </item>
  </channel>
</rss>
