發表文章

目前顯示的是 5月, 2017的文章

Python 找質數 ( Python: Prime Numbers Finding )

圖片
維基百科上 質數 的定義為: 「指在大於1的自然數中,除了1和該數自身外,無法被其他自然數整除的數(也可定義為只有1與該數本身兩個因數的數)」 一個著名且有效率的方法: Sieve of Eratosthenes 用 Python 來實現 Sieve of Eratosthenes: 若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much.

Python 排序演算法範例 ( Sorting Algorithms in Python )

圖片
前陣子看到真人上演 Sorting Algorithms 的影片: There are a tutorial video about sorting algorithms: 影片中介紹了Insertion Sort, Selection Sort, Merge Sort, Bubble Sort。筆者就用蟒蛇(Python)來示範這四個排序演算法吧! The video introduces four sorting algorithms: Insertion Sort, Selection Sort, Merge Sort, Bubble Sort. Let me show you how to implement these algorithms in Python. 插入排序 Insertion Sort: 選擇排序 Selection Sort: 合併排序 Merge Sort: 泡沫排序 Bubble Sort: 參考資料: [1] 插入排序 [2] 選擇排序 [3]  氣泡排序 [4]  合併排序 若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much.

雷射切割四足機器人mePed v1.0

圖片
延續 【 3D 列印四足獸 Mini Quadruped 】一文, 此次到手的是雷射切割的四足機器人 mePed v1.0 , 與Arduino Nano的數位腳位接線為從右上開始 逆時針方向一圈 : 臀部的角度如下圖: 每一隻腳的角度如下:朝上為0度、朝下為180度。 首先用Android手機藍牙控制八個關節的程式( 程式下載處 ): 接著用官方給的  mePed Starter Program , 影片中的程式為筆者修改過的程式 。 筆者將 Alexey's Program 與  mePed v2 Start Program 合併後,做出如下影片的功能( 程式下載處 ): 若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much.