Spring 2023 | 運算思維與程式設計課程專題 Computational thinking and programming Course Project
Spring 2023 | 運算思維與程式設計課程專題 Computational thinking and programming Course Project
以Python語言實作八人過河問題,問題設定包含船隻僅能乘載兩人,僅部分成員能操控船,以及多項限制條件。藉由九位元布林串列表示船與人物位置,並排除違反規則的非法狀態,構建合法狀態圖,再以最短路徑演算法搜尋全員由東岸至西岸的最小步數解。此專案為第一次學習Python程式設計,並以模組化方式解決經典謎題。
Implemented the Eight-Person River Crossing problem in Python, where the boat can carry only two people, only certain members can operate it, and multiple constraints apply. Represented boat and character positions using a 9-bit Boolean list, eliminated illegal states, constructed a valid state graph, and applied a shortest-path algorithm to find the minimal steps to move everyone from the east to the west bank. This project marked my first experience with Python programming and applied a modular approach to solve a classic puzzle.