cp2025 計算機程式

  • Home
    • SMap
    • reveal
    • blog
  • About
    • cs101
    • Computer
      • llama
      • nginx
    • AI
      • QandA
      • Teams
    • Homework
  • Topics
    • Git
      • Git_ex1
      • Git_ex2
    • Python
      • SE
      • CL
      • Loops
      • Recursion
      • SA
      • SST
      • Maze
      • Collect
      • GT
      • Python_ex1
    • Javascript
      • HTML and CSS
    • Project
      • Waitress
      • API
  • Brython
    • Brython_ex
    • Robot_ex
  • Ref
    • Reeborg
      • ex1
      • Otto_ninja
    • tkinter
    • Pyodide
    • Pyodide_ex
    • Pyodide2
      • robot.py
      • Example2
    • Pyodide3
      • png_files
      • Harvest
Example2 << Previous Next >> png_files

Pyodide3

Pyodide3 則在 Pyodide 與 Pyodide2 頁面架構下,進一步導入 robot_w_world.py,在既有的水平圍牆 north.png 與垂直圍牆 east.png 檔案之外,加入 carrot.png、grass.png 與 pale_grass.png 等圖檔。並且擴充可從 URL 讀進 json 格式的 world 變數功能,以便製作出更多元的場景任務,要求機器人執行。

其中 src URL 變數,可以將網路上的機器人控制程式導入 Pyodide3 頁面外,world URL 變數則可以導入源自 Reeborg 機器人程式所設定的 json 格式場景。

由於 Reeborg 系統中的 png 圖檔均非透明背景,robot_w_world.py 必須利用 HTML 中的 CANVAS,將關鍵的白色背景,以透明的方式顯示。

src URL 變數讀進 turn_right 程式,而 world URL 變數則讀進 harvest2.json,執行結果。

讀進 harvest3.json, 執行結果。


從 1 累加到 100 part2:


Example2 << Previous Next >> png_files

Copyright © All rights reserved | This template is made with by Colorlib