Skip to main content

Maze - Blockly Games













Blockly Games : Maze 1
Question 問題:

Solution 解答:


moveForward();
moveForward();

Blockly Games : Maze 2

Question 問題:



Solution 解答:



moveForward();
turnLeft();
moveForward();
turnRight();
moveForward();

Blockly Games : Maze 3

Question 問題:


Solution 解答:



while (notDone()) {
  moveForward();
}
Blockly Games : Maze 4

Question 問題:


Solution 解答:

while (notDone()) {
  moveForward();
  turnLeft();
  moveForward();
  turnRight();
}

Blockly Games : Maze 5

Question 問題:


Solution 解答:

moveForward();
moveForward();
turnLeft();
while (notDone()) {
  moveForward();
}
Blockly Games : Maze 6

Question 問題:


Solution 解答:

while (notDone()) {
  moveForward();
  if (isPathLeft()) {
    turnLeft();
  }
}
Blockly Games : Maze 7

Question 問題:



Solution 解答:



while (notDone()) {
  moveForward();
  if (isPathRight()) {
    turnRight();
  }
}
Blockly Games : Maze 8

Question 問題:


Solution 解答:


while (notDone()) {
  moveForward();
  if (isPathLeft()) {
    turnLeft();
  }
  if (isPathRight()) {
    turnRight();
  }
}
Blockly Games : Maze 9

Question 問題:


Solution 解答:


while (notDone()) {
  if (isPathForward()) {
    moveForward();
  } else {
    turnLeft();
  }
}

Blockly Games : Maze 10

Question 問題:



Solution 解答:


while (notDone()) {
  moveForward();
  if (isPathForward()) {
    if (isPathRight()) {
      turnRight();
    } else {
      if (isPathLeft()) {
        turnLeft();
      } else {
      }
    }
  } else {
    if (isPathLeft()) {
      turnLeft();
    } else {
      turnRight();
    }
  }
}


Comments

Popular posts from this blog

KSB037 Motor Board 馬達板擴充積木

KSB037 Motor Board 馬達板擴充積木 key: makeblock,microbit,motor Description 說明: 使用 KSB037 Motor Board 馬達板擴充積木 https://github.com/edisonchiu/pxt-motor-KSB037 History v0.1 來源版本 https://github.com/lioujj/KSB037 v0.2 修正字串錯誤 Step 步驟: 1. Makeblock -> Advanced -> Add Package 2. 在 Search or enter project URL… 輸入擴充積木網址,      https://github.com/edisonchiu/pxt-motor-KSB037 3. 按下搜尋會出現擴充積木,按下去新增擴充積木 4. 積木區就會出現新的積木可以用了。 KSB037 馬達擴充板 擴充積木測試程式 KSB037_CustomBlock_Test 目的說明: 按下按鈕可以測試馬達和板子是否正常運作 注意事項: 馬達擴充板 外接馬達需要外接電源,且電源開關需要開啟。 馬達擴充板 指撥開關 2,3,4,5 需要在 ON 的狀態。 功能說明: 按 A 左邊馬達往前全速(1023)運轉。 按 B 右邊馬達往前全速(1023)運轉。 按 A+B 兩邊邊馬達同時往前全速(1023)運轉。 以上皆非則馬達停止顯示中心一個點。 micro:bit - KSB037 Motor Simple Test (JavaScript) Source Code 源碼如下:

How to use voice input on PC 如何在電腦上使用語音輸入

How to use voice input on PC 如何在電腦上使用語音輸入 #Voice,Input,Windows 10,Google Doc,Google Translate, 工作,技巧 在電腦上語音輸入有下列幾種方式 使用語音輸入 - Windows 10  使用語音輸入 - Google Doc  使用語音輸入 - Google Translate  1.使用語音輸入 - Windows 10 Windows 10 -> 控制台 -> 語音辨識 https://support.microsoft.com/zh-tw/help/17208 按照說明作基本的語音訓練。 Windows 語音辨識命令 - Windows 說明 https://support.microsoft.com/zh-tw/help/12427/windows-speech-recognition-commands 2. 使用語音輸入 - Google Doc 使用語音輸入功能 - 文件編輯器說明 https://support.google.com/docs/answer/4492226?hl=zh-Hant 使用語音輸入功能 您可以在 Google 文件或 Google 簡報的演講者備忘稿中,透過語音功能來輸入及編輯文件內容。 注意 :這項功能只能在 Chrome 瀏覽器中使用。 步驟 1:開啟麥克風 您必須開啟電腦的麥克風 (而且麥可風可正常運作),才能使用語音輸入功能或語音指令。 由於各款裝置和麥克風有所差異,請參閱您的電腦手冊瞭解操作方式。一般而言,Mac 的麥克風設定位於 系統偏好設定 ,PC 的麥克風設定則位於 控制台 。 步驟 2:使用語音輸入功能 步驟 3:使用語音指令 開啟語音輸入功能後,您可以利用指令來編輯文件及設定文件格式,例如「Select paragraph (選取段落)」、「italics (斜體)」或「Go to the end of the line (前往行尾)」。 注意事項 : 系統僅支援英文語音指令 (帳戶語言和文件語言都必須是英文)。 ...

RF Remote 遙控器

  # RF Remote 遙控器發射端 -------------------------------------------------------- StartUp 當啟動時() sendZeroSet搖桿校正 Radio Group 廣播群組設為 = 1 -------------------------------------------------------- Forever 重複無限次() X1 Y1 = (x,y) buttonProc按鈕程序 -------------------------------------------------------- KEY D sendZeroSet搖桿校正 -------------------------------------------------------- buttonProc 按鈕程序() KEY   1 2 3 45670 -------------------------------------------------------- sendZeroSet 搖桿校正() X0 Y0 = (x,y) -------------------------------------------------------- # RF Car 機器人接收端 # Variables 變數定義 ---------------------------------------- KEY 0=未按下 1=A,2=B,..34567(按鍵) X0,Y0 類比搖桿初始位置值 X,Y 類比搖桿移動位置值 X=X1-X0,Y=Y1=Y0 speed = min(abs(Y)*2,1023) speed_L = speedFitRange(speed+(X*2)) speed_R = speedFitRange(speed-(X*2)) ---------------------------------------- # Status Flag 狀態旗標 flag_set_zero 類比搖桿是否有歸零 flag_update 是否有收到更新值 flag_run 馬達是否啟動 --------------------------------...