之前發過用Eclipse 開發 Android 二到九位數的 ?A?B猜數字遊戲,當時的程式碼更新為 Android Studio 版本,弄出如下圖的功能:
而本篇要用 Python + Tkinter 來實作,UI的Layout設計方式如下:
此版本為數字可重複,那要如何改成數字不重複的版本呢?
程式設計可以改變您的未來(Programming can change your future)。 雲林SONG 全名為雲林軟體工程(SOftware eNGineering),目標致力於軟體人才的培養並推廣開源軟體落實於資訊教育。程式設計的觀念是軟體產品的基礎,程式碼就像沙子一樣,要紮實,所建立出來的高塔才會穩固。本站也提供資訊教育相關的教學資源。 YunlinSONG stands for Yunlin SOftware eNGineering, offering tutorial for computer programming and promoting open-source software. Teaching resources in information technology education are provided here.
Label1 | SpinBox1 | |
---|---|---|
Label2 | Entry1 | Button1 |
Label3 | Button2 |
RANDBETWEEN(low, high)
low
- The low end of the random range.high
- The high end of the random range.範例:urtle.
write
(arg, move=False, align="left", font=("Arial", 8, "normal"))
Write text - the string representation of arg - at the current turtle position according to align (“left”, “center” or right”) and with the given font. If move is true, the pen is moved to the bottom-right corner of the text. By default, move is
Parameters:
- arg – object to be written to the TurtleScreen
- move – True/False
- align – one of the strings “left”, “center” or right”
- font – a triple (fontname, fontsize, fonttype)
False
.
turtle.
circle
(radius, extent=None, steps=None)Parameters: |
|
---|