# 4rdp puzzle timer
from microbit import *
from random import randint
import utime
shapes = "TIJLOSZTIJLOSZTIJLOSZTIJLOSZTIJLOSZT "
display.show("-")
while True:
if button_a.was_pressed():
display.show(" ")
sleep(100)
ln = len(shapes)
if ln == 37:
t0 = utime.ticks_ms()
elif ln == 1:
t1 = utime.ticks_ms()
break
r = randint(0,ln-2)
display.show(shapes[r])
if r == 0:
shapes = shapes[1:]
else:
shapes = shapes[0:r] + shapes[r+1:]
display.show("=")
while not button_a.was_pressed():
sleep(1)
else:
t = (t1 - t0)//1000
m = t //60
s = t % 60
if s < 10:
s = "0"+str(s)
else:
s = str(s)
display.scroll(str(m)+":"+s,loop=True)
七月底曾發佈 4rdp 拼圖抽籤 Python 程式,這次再追加計時功能,仍然使用 A 鍵,每按一次 隨機抽一個拼塊,在按第一鍵時,也同時啟動計時。
受日本網友啟發創作「幾何光束︱GeoRay」
-
「幾何光束」從起意到製作完成,只有短短的兩三天時間。期間還經歷了quanAI因超額而不能用了,好在claude免費版的數學和寫代碼能力也是超強的。
直接把玩: georay.ejsoon.top
當我在某論壇上見到這位日本朋友做的一款在圓內分割的遊戲,我就萌生了做這款遊戲的想法。很快在AI的幫助下,這個想法變...
1 天前

沒有留言:
張貼留言