Skip to main content

Posts

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 解答: ...

Open The Lock - Grasshopper

Open The Lock - Grasshopper Question 問題: YOUR CODE var pinNumber = 10; var foundKey = pickRandom([‘yes’,’no’]); print(‘pinNumber is ‘ + pinNumber); print(‘foundKey is ‘ + foundKey); if (foundKey === ‘yes’ && pinNumber=== 10) {     print(‘You opened the lock!‘); } if (foundKey === ‘yes’ && pinNumber=== 10) {     print(‘The pin number is right, but you are missing the key.‘); } Sample code solution 解答: YOUR CODE var pinNumber = 10; var foundKey = pickRandom([‘yes’,’no’]); print(‘pinNumber is ‘ + pinNumber); print(‘foundKey is ‘ + foundKey); if (foundKey === ‘yes’ && pinNumber=== 10) {     print(‘You opened the lock!‘); } if (foundKey === ‘no’ && pinNumber=== 10) {     print(‘The pin number is right, but you are missing the key.‘); } Details 說明: 只要把 foundKey === ‘yes’ 改成 no 就可以 主程式沒把宣告放上去,是為了凸顯主題,不過...

Image Decoder - Grasshopper

  Image Decoder Details 詳細解說: // 宣告變數 img, 型態自動依初始值設為字串 // 設定初始值為存放影像編碼 var img = "ewvveewvvw wiiwiiw webbwbbew weeggweggw ewyyewyyew woowoowe wrreewrrw"; 程式一開始宣告變數 img 存放影像編碼,影像編碼內穿插了 ‘e’ 這個字元符號,這個多餘的字元符號可以是任何沒有使用到的字元都可以替代,例如使用 ‘x’,或是使用兩種以上都可以,不過程式解碼時要記得都要濾掉。 這些多餘的字元符號把原來的圖案弄亂,所以可以讓不知道解碼的人看不出來是什麼圖案。如果我們收到知道如何解碼,可以把 'e' 字元符號去掉(Filter out 'e’),就可以看到原來的圖案了 IMAGE DATA // 原來要顯示的圖樣 空白字元表示換行 var img =      "wvvwvvw wiiwiiw wbbwbbw wggwggw wyywyyw woowoow wrrwrrw" IMAGE DATA ENCODE // 影像編碼內穿插了 ‘e’ 這個字元符號,把原來的圖案弄亂 var img = "ewvveewvvw wiiwiiw webbwbbew weeggweggw ewyyewyyew woowoowe wrreewrrw" // 解碼部分,依序判斷陣列中的字元不為’e’ 則畫出編碼內容方塊 for (var letter of img) {   if (letter !== ‘e’) {     drawBoxes(letter);   } } // 將變數 img 印出,  print(img); 因為我們並沒有改變 img 內容,所以 img 內容仍是含有 ’e’ 字元未解碼的狀態  YOUR CODE // 宣告變數 img, 型態自動依初始值設為字串 // 設定初始值為存放影像編碼 var img = "ewvveewvvw wiiwiiw webbwbbew weeggweggw ewyyewyyew woo...

How to capture or save all scroll of the webpage to picture or files? 如何將網頁或是新聞整頁(包含卷軸下)存起來

整理的方法有下列幾種: 將網頁內容儲存至 Google 雲端硬碟 - #PC 將網頁內容儲存至 Google 雲端硬碟 - #Android 使用 Google 雲端列印  - #Android 將網頁內容儲存至 Evernote - #Android #Evernote "在PC上" 將網頁內容儲存至 “Google 雲端硬碟” - #PC #Google Drive https://docs.google.com/document/d/1E2MFOfmDAnGcGQ8Hvnst9iRZGeSj5H7G7xrsbOQLpbA/edit#bookmark=id.2qgcrsl2s1sf 說明: 可以設定要儲存網頁到那一個 Google Drive 資料夾 可以自訂另存網頁為: 將整個網頁存成圖片 (.png) [圖片] 自動捲動擷取網頁為PNG圖檔,排版就瀏覽器看到的格式儲存不會跑掉,占檔案空間較大。 將顯示的網頁內容另存圖片 (.png) [圖片] 只擷取目前顯示在螢幕上的網頁為PNG圖檔(不自動捲動),排版就瀏覽器看到的格式儲存不會跑掉,占檔案空間大。 HTML 來源 (.html) [文字] 擷取網頁為HTML文字檔原始檔,連結及圖檔則還是用原來超連結,不會真的存下來,所以網路上的圖片如果被刪除就看不到了。占檔案空間很小。 網頁封存 (.mht) [文字] 擷取網頁為 mht 網頁封存檔,連結及圖檔有儲存在檔案中所以占檔案空間較大, 在 Google Drive 中不能直接開啟觀看,需要下載用瀏覽起開啟。 Google 文件 [文字] 擷取網頁為 Google Doc 格式文件,排版可能會跑掉, 由於使用  Google Doc 格式所以不占 Google 空間。 將網頁內容儲存至 Google 雲端硬碟 - 電腦 - Google 雲端硬碟說明 https://support.google.com/drive/answer/2375013?hl=zh-Hant&ref_topic=2375187 取得「儲存至 Google 雲端硬碟」Chrome 擴充功能 您可以從 Chrome 線上應用...