0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ScratchのスクリプトをAIに渡す方法 3選

0
Posted at

Scratchで作ったプログラムをAIに渡す方法です

image.png

1. 画像を渡す

image.png

import time

# 「メッセージ1」を受け取ったときの処理(関数)
def when_receive_message_1():
    # ここにメッセージを受け取ったときの処理を書きます
    print("メッセージ1を受信しました!") 

# 緑の旗が押されたとき(メイン処理)
def main():
    # 10回繰り返す
    for _ in range(10):
        when_receive_message_1()  # 「メッセージ1」を送る
        time.sleep(1)            # 1秒待つ

if __name__ == "__main__":
    main()

2.ダウンロードした .sb3 を渡す

image.png

⚑ がクリックされたとき
⚙ 10 回繰り返す
└─ ✉「メッセージ1」を送る
   ⏳ 1 秒待つ

file構成までしか教えてくれなかったら
image.png

3. 拡張子 .sb3.zip に書き換え、中のproject.jsonを渡す

  1. image.png
⚑ がクリックされたとき
⚙ 10 回繰り返す
└─ ✉「メッセージ1」を送る
   ⏳ 1 秒待つ
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?