ㄴㅇㄹㄴㄱㅇㅋㅁ
페이지 정보
작성자 ㅁㄷㄱㅎ (211.♡.168.221) 작성일 24-11-01 10:29 조회 82 댓글 0본문
from microbit import *
import radio
import audio
import random
radio.config(group=17)
radio.on()
timer = -1
myTurn = False
while True:
if button_a.was_pressed() and button_b.was_pressed():
display.show("3")
sleep(500)
display.show("2")
sleep(500)
display.show("1")
sleep(500)
display.clear()
myTurn = True
timer = random.randint(5,30)
if accelerometer.was_gesture('shake'):
radio.send(str(timer))
myTurn = False
display.clear()
audio.play(Sound.GIGGLE)
if myTurn:
if timer > 0:
sleep(1000)
timer = timer - 1
display.show(Image.SKULL)
print(timer)
else :
audio.play(Sound.SOARING, wait=False)
display.scroll("Loser")
message = radio.receive()
if message :
timer = int(message)
myTurn=True
import radio
import audio
import random
radio.config(group=17)
radio.on()
timer = -1
myTurn = False
while True:
if button_a.was_pressed() and button_b.was_pressed():
display.show("3")
sleep(500)
display.show("2")
sleep(500)
display.show("1")
sleep(500)
display.clear()
myTurn = True
timer = random.randint(5,30)
if accelerometer.was_gesture('shake'):
radio.send(str(timer))
myTurn = False
display.clear()
audio.play(Sound.GIGGLE)
if myTurn:
if timer > 0:
sleep(1000)
timer = timer - 1
display.show(Image.SKULL)
print(timer)
else :
audio.play(Sound.SOARING, wait=False)
display.scroll("Loser")
message = radio.receive()
if message :
timer = int(message)
myTurn=True
좋아요0
이 글을 좋아요하셨습니다
등록된 댓글이 없습니다.