<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>大樂透程式開發流程 by 20518吳柏志</title>
      <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6</link>
      <description>111 高二 ＜C班群＞資訊課程</description>
      <language>en-us</language>
      <pubDate>2023-03-30 01:27:14 UTC</pubDate>
      <lastBuildDate>2023-04-27 01:38:14 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f4bb.png</url>
      </image>
      <item>
         <title>抽籤/取亂數(第一次實作)</title>
         <author>s11030062</author>
         <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537562036</link>
         <description><![CDATA[<pre>import random<br><br>box = []<br>for i in range(6):<br>&nbsp; box.append(random.randrange(0, 101, 2))<br>print(box)</pre>]]></description>
         <enclosure url="https://www.onlinegdb.com/hjAzDYTzl" />
         <pubDate>2023-03-30 01:29:46 UTC</pubDate>
         <guid>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537562036</guid>
      </item>
      <item>
         <title>將亂數排序(第二次實作)</title>
         <author>s11030062</author>
         <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537567652</link>
         <description><![CDATA[<pre>import random<br><br># 泡沫排序<br>def bubble_sort(arr):<br>&nbsp; &nbsp; n = len(arr)<br>&nbsp; &nbsp; for i in range(n):<br>&nbsp; &nbsp; &nbsp; &nbsp; for j in range(0, n-i-1):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if arr[j] &gt; arr[j+1]:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j], arr[j+1] = arr[j+1], arr[j]<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br># 隨機抽樣(1~100)<br>box = []<br>result = []<br>for i in range(6):<br>&nbsp; box.append(random.randrange(1, 50))<br>print("前:", box)<br><br># 輸出排序後的抽樣結果<br>bubble_sort(box)<br>for i in range(len(box)):<br>&nbsp; &nbsp; result.append(box[i])<br>print("後:", result)</pre>]]></description>
         <enclosure url="https://www.onlinegdb.com/fUFMLtmlE5" />
         <pubDate>2023-03-30 01:33:41 UTC</pubDate>
         <guid>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537567652</guid>
      </item>
      <item>
         <title>抽獎號碼不可以重覆(第三次實作)</title>
         <author>s11030062</author>
         <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537574155</link>
         <description><![CDATA[<pre>import random

# 泡沫排序
def bubble_sort(arr):
    n = len(arr)
    for i in range(n):
        for j in range(0, n-i-1):
            if arr[j] &gt; arr[j+1]:
                arr[j], arr[j+1] = arr[j+1], arr[j]
                
# 隨機抽樣(1~100)
box = []
result = []
box = random.sample(range(1, 50), 6) # 號碼不重複

# 排序前結果
print("前:", box) 

# 排序後結果
bubble_sort(box)
for i in range(len(box)):
    result.append(box[i])
print("後:", result)</pre>]]></description>
         <enclosure url="https://www.onlinegdb.com/edit/pHfx3xqfN" />
         <pubDate>2023-03-30 01:38:21 UTC</pubDate>
         <guid>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537574155</guid>
      </item>
      <item>
         <title>產生 [N期] 的中獎號碼</title>
         <author>s11030062</author>
         <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537576120</link>
         <description><![CDATA[<pre>import random<br><br># 詢問要第幾期結果<br>n = int(input("請問要第幾期? "))<br><br># 泡沫排序<br>def bubble_sort(arr):<br>&nbsp; &nbsp; n = len(arr)<br>&nbsp; &nbsp; for i in range(n):<br>&nbsp; &nbsp; &nbsp; &nbsp; for j in range(0, n-i-1):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if arr[j] &gt; arr[j+1]:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j], arr[j+1] = arr[j+1], arr[j]<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br># 隨機抽樣N次<br>for k in range(n):<br>&nbsp; &nbsp; box = []<br>&nbsp; &nbsp; result = []<br>&nbsp; &nbsp; box = random.sample(range(1, 50), 6) # 號碼不重複<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # 排序後結果<br>&nbsp; &nbsp; bubble_sort(box)<br>&nbsp; &nbsp; for i in range(len(box)):<br>&nbsp; &nbsp; &nbsp; &nbsp; result.append(box[i])<br>&nbsp; &nbsp; # 輸出第N期結果&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; print(f"第{k+1}期: ",result)</pre>]]></description>
         <enclosure url="https://www.onlinegdb.com/myW8LySC9" />
         <pubDate>2023-03-30 01:39:45 UTC</pubDate>
         <guid>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2537576120</guid>
      </item>
      <item>
         <title>加上特別號 / 查詢期別</title>
         <author>s11030062</author>
         <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2568951015</link>
         <description><![CDATA[<pre>import random<br><br># 詢問要第幾期結果<br>n = int(input("要產生多少期號碼? "))<br>s = int(input("要查看第幾期號碼? "))<br><br># 泡沫排序<br>def bubble_sort(arr):<br>&nbsp; &nbsp; n = len(arr)<br>&nbsp; &nbsp; for i in range(n):<br>&nbsp; &nbsp; &nbsp; &nbsp; for j in range(0, n-i-1):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if arr[j] &gt; arr[j+1]:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j], arr[j+1] = arr[j+1], arr[j]<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br># 隨機抽樣N次<br>for k in range(n):<br>&nbsp; &nbsp; box = []<br>&nbsp; &nbsp; number = []<br>&nbsp; &nbsp; result = {}<br>&nbsp; &nbsp; box = random.sample(range(1, 50), 6) # 號碼不重複<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # 排序後結果<br>&nbsp; &nbsp; bubble_sort(box)<br>&nbsp; &nbsp; for i in range(len(box)):<br>&nbsp; &nbsp; &nbsp; &nbsp; number.append(box[i])<br>&nbsp; &nbsp; # 輸出第N期結果&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; result[f"第{k+1}期"] = number<br>&nbsp; &nbsp; print(result)<br>&nbsp; &nbsp; # 第s期號碼查詢<br>&nbsp; &nbsp; if k+1 == s:<br>&nbsp; &nbsp; &nbsp; &nbsp; print(f"第{k+1}期中獎號碼",result[f"第{k+1}期"],"特別號:", result[f"第{k+1}期"][5])</pre>]]></description>
         <enclosure url="https://www.onlinegdb.com/NP7RDDSgA" />
         <pubDate>2023-04-26 15:06:17 UTC</pubDate>
         <guid>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2568951015</guid>
      </item>
      <item>
         <title>選擇+條件判斷</title>
         <author>s11030062</author>
         <link>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2568953643</link>
         <description><![CDATA[<pre>import random<br><br>question = 0<br># 詢問要第幾期結果<br>while question == 0:<br>&nbsp; &nbsp; x = 0<br>&nbsp; &nbsp; y = 0<br>&nbsp; &nbsp; n = 10<br>&nbsp; &nbsp; s = int(input("要查看第幾期號碼? "))<br>&nbsp; &nbsp; p = int(input("對獎號碼?"))<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # 泡沫排序<br>&nbsp; &nbsp; def bubble_sort(arr):<br>&nbsp; &nbsp; &nbsp; &nbsp; n = len(arr)<br>&nbsp; &nbsp; &nbsp; &nbsp; for i in range(n):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for j in range(0, n-i-1):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if arr[j] &gt; arr[j+1]:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j], arr[j+1] = arr[j+1], arr[j]<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; # 隨機抽樣N次<br>&nbsp; &nbsp; for k in range(n):<br>&nbsp; &nbsp; &nbsp; &nbsp; box = []<br>&nbsp; &nbsp; &nbsp; &nbsp; number = []<br>&nbsp; &nbsp; &nbsp; &nbsp; result = {}<br>&nbsp; &nbsp; &nbsp; &nbsp; box = random.sample(range(1, 50), 6) # 號碼不重複<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; # 排序後結果<br>&nbsp; &nbsp; &nbsp; &nbsp; bubble_sort(box)<br>&nbsp; &nbsp; &nbsp; &nbsp; for i in range(len(box)):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; number.append(box[i])<br>&nbsp; &nbsp; &nbsp; &nbsp; # 輸出第N期結果&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; result[f"第{k+1}期"] = number<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; if p in result[f"第{k+1}期"]:<br>&nbsp; &nbsp; &nbsp; &nbsp; print("yes")<br>&nbsp; &nbsp; &nbsp; &nbsp; x = input("要繼續嗎?(要/不要)")<br>&nbsp; &nbsp; &nbsp; &nbsp; if x == "要":<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; question = 0<br>&nbsp; &nbsp; &nbsp; &nbsp; if y == "不要":<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; question = 1<br>&nbsp; &nbsp; else:<br>&nbsp; &nbsp; &nbsp; &nbsp; print("no")<br>&nbsp; &nbsp; &nbsp; &nbsp; x = input("要繼續嗎?(要/不要)")<br>&nbsp; &nbsp; &nbsp; &nbsp; if x == "要":<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; question = 0<br>&nbsp; &nbsp; &nbsp; &nbsp; if y == "不要":<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; question = 1</pre>]]></description>
         <enclosure url="https://www.onlinegdb.com/1OUgP-m4R" />
         <pubDate>2023-04-26 15:08:08 UTC</pubDate>
         <guid>https://padlet.com/s11030062/q2rr5v8xxp37p5a6/wish/2568953643</guid>
      </item>
   </channel>
</rss>
