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
Maze << Previous Next >> GT

Collect

收集物品並排序(模擬排序演算法)
雖然 Reeborg 不支援陣列,但可模擬排序邏輯。

# 範例 1:模擬選擇排序(假設物品代表數值)
# 這部分需創造任務場景,例如物品代表大小

# 範例 2:依序撿起並放置(模擬排序)
while object_here():
    take()
    move()
    put()

# 範例 3:模擬交換位置
# 假設兩格有物品,交換位置
take()
move()
take()
turn_left()
turn_left()
move()
put()
turn_left()
turn_left()
move()
put()

Maze << Previous Next >> GT

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