有沒有人會C程式語言,幫幫忙@@

看板cksh75th09作者 (鬍子)時間22年前 (2002/05/14 17:44), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/8 (看更多)
我作業寫不出來啊 事關畢業麻煩會的人幫一下吧=_= Write a program that simulates a random walk of a robot in the empty room below.A random walk is one where the next step taken by the robot is always randomly either to the left, right, ahead, or back. #################### # # # # # # # 出口 # # # # 入口 # # # #################### The room will be stored in a 2-D array of size 10-by-20. This includes the walls. the initial position of the robot is at row 7, column 0,and will be marked with an 'r'. As soon as this initial position is left, the door will close; i.e., the cell will be replaced with a # sign. Define the functions move_up(), move_down(), move_left(), and move_right() to simulate a move. These functions will take the 2-D array as argument and will mark the new cell occupied with an 'r', changing the old position to an asterisk(*). Should a move be illegal, the robot will not move. A move is illegal if an attempt is made to move into the wall. These functions must know what the current position (row and column) of the robot is at all times, To this end, define two global index variables cur_row and cur_col of the current position. the program will let the robot walk until it finds the exit. There is a possibility that this may take quite some time, so the pargram will prompt for the maximum number of steps the user wants the robot to take. In the end, the room and the traces of the walk will be shown on the screen. 會的人教一下吧>< 我就連如何下手都不知道=_= -- 憑藉黑暗的寶座,風之精靈前來..... 以古老的神秘力量降臨在崇敬的王座上.        闇之王,光之王衝破黑暗,毀滅粉碎之人..... 以九十九光蛇之名.....消滅我方敵人!                     打!!雷!!擊!!  -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.121.204.33
文章代碼(AID): #yuDni00 (cksh75th09)
討論串 (同標題文章)
文章代碼(AID): #yuDni00 (cksh75th09)