ŠĻą”±į>ž’ …‡ž’’’ƒ„’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ģ„Į` šæl3bjbjĖsĖs 1^©©l+’’’’’’¤(((((((^FCFCFCFCbCŒb YSĀśCśCśCśCśCśCśCśCŲRŚRŚRŚRŚRŚRŚR$VhƒX„žR(śCśCśCśCśCžR((śCśCSXJXJXJśC:(śC(śCŲRXJśCŲRXJXJŽųQh((øRśCīC ą¢6ÅBųĘFC4Gž`RHŲR)S0YSØRY2JY øRY(øR śCśCXJśCśCśCśCśCžRžRNJ śCśCśCYSśCśCśCśCb b b ä8FCb b b FC<P^((((((’’’’ Introduction to C - Programming Assignment #5 Assigned: 10/24/06 Due: 11/10/06 (Friday) at 3:00am WebCT Time Note: There are two parts to this assignment!!! Objective 1. To learn how to manipulate one-dimensional arrays. 2. To give students experience using #include with project-specific source files 3. To give students experience integrating special pre-written functions into their code Deliverables Although there are two parts to this program, you only need to turn in one source file, maze.c, that encompasses both parts of the program (since the second part of the program incorporates the first part anyway). We have divided this write-up into two parts primarily to assist in its readability and clarity. Also, note that you cannot modify maze_gen.c or maze_gen.h!! When we compile your program, we will use our original copies of those files to do so! Problem A: Display a 2D Maze from a 1D Character Array In this program, you will declare a one-dimensional array of characters, call a pre-written function that creates an ASCII maze and saves it in your array, and then display the maze in two-dimensions. There will be three steps to this first problem, and they are outlined below: a.) Including the pre-written maze creation function and supporting functions Download both maze_gen.c and maze_gen.h from the course assignments page and save them in the working directory where you will be compiling and running the code for this programming assignment. At the top of your code, just after your #include statement, include the following line of code: #include “maze_gen.c” This will include a number of functions used to create an nxn square ASCII maze. Most of these are just functions that support the creation of ASCII mazes, and you don't need to know anything about them. You will, however, need to use one particular function: maze_create(). If you have trouble with the #include statement, you may want to make sure that you have the files saved in the right directory, double check that you are using “quotes” and not around the filename, “maze_gen.c”, and ensure that you downloaded both maze_gen.c and maze_gen.h, even though you are only using #include on one of those files. (maze_gen.c will actually #include maze_gen.h for you.) Calling the pre-written maze creation function The maze_create function has the following functional prototype: int maze_create(char *maze, int n); The function will take the name of a one-dimensional array of characters as its first argument, and the width of the maze to be created as its second argument. It will create a square ASCII maze of n * n characters and store the characters in the array whose name you passed to the function. Thus, your character array should be of size n * n. For example: maze_create(myMaze, 5); The above statement will create a 5 x 5 square maze, and store those 25 characters in the array called myMaze, which should be declared to be of type char and size 25. In the maze, a wall is represented by the character '#', a place where someone can walk is represented by a space ' ' character, the starting point of the maze is marked by a lower-case 's', and the ending point of the maze is marked by a lower-case 'e'. The size of the maze, n, is restricted as follows: n must be greater than or equal to 5. n must be odd. It is your responsibility to ensure that the value of n is acceptable before calling maze_create! You may assume that we will not test your program with a value of n greater than 25. Thus, the largest your character array will have to be is 25 * 25 = 625. Displaying the maze After calling maze_create(), your array will contain n * n characters. Your job is now to print out the first n characters on one line, the second n characters on the next line, the third n characters on the next line, and so on, until all characters are displayed. For example, suppose you have a maze where n = 5, and the following 25 characters are stored in the array after calling maze_create() (we have included numbers below each character to help make this more readable): #####s # e# # ## ###### 0123456789012345678901234 Then you will want to display to the screen: ##### s # e # # # # # ##### This constitutes the entire first part of your assignment: integrating the provided source code using a #include statement, calling the maze_create() function, and then properly displaying the maze that the function sets up for you. Special Restrictions: Reusing the names of any of the functions defined in maze_gen.c as identifiers in the new source code will cause you trouble. Avoid using the following names when declaring your functions or making variable names: maze_color, remove_wall, maze_create, joinsSomethingUseful, joinsSameColor, wall_status_update, inBounds Defining global variables of any sort may interfere with the functions defined in maze_gen.c. Avoid using global variables of any kind. (This is also a good programming practice in general.) Input Specification n, where the size of the maze is n*n, will be an integer. You must perform the necessary checks to ensure that n is greater than or equal to 5, and that it is odd! Output Sample Here is one sample output of running the program. Note that this test is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given. The user input is given in italics while the program output is in bold. Sample Run #1 What dimension shall we use for the maze? 2 Invalid input. Please enter an odd integer that is greater than 4: -1 Invalid input. Please enter an odd integer that is greater than 4: 4 Invalid input. Please enter an odd integer that is greater than 4: 5 Here is the randomly generated maze: ##### s # ### # # e ##### Sample Run #2 What dimension shall we use for the maze? 7 Here is the randomly generated maze: ####### s # ##### # # # # # ### # # e ####### Sample Run #3 What dimension shall we use for the maze? 7 Here is the randomly generated maze: ####### s # # ### # # # # e ### # # # # ####### Problem B: ASCII Maze Game Now modify your program from Problem A to allow the user to navigate the maze! As before, you will call maze_create to populate your character array with an ASCII maze. This time, however, you will place a little person (represented by the '@' character) on the board, and allow him (or her) to move around the maze. You must prevent the character from stepping onto walls, and you must also detect when the character reaches the exit of the maze, and end the game. Input Specification n, where the size of the maze is n*n, will be an integer. You must perform the necessary checks to ensure that n is greater than or equal to 5, and that it is odd! To navigate, the user will enter a single character and then hit enter. The user may enter a letter you're not expecting, in which case you must catch the error! (Note: you MUST use the characters i, m, j, and k to represent moves up, down, left, and right, respectively. The TA's do not want to have to adapt to new navigation controls in each program they grade!) Output Sample Here are two sample outputs of running the program. Note that this test is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given. The user input is given in italics while the program output is in bold. Sample Run #1 What dimension shall we use for the maze? 3 Invalid input. Please enter an odd integer that is greater than four: 5 ##### @ # # ### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ##### s@ # # ### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): i You can't move up! ##### s@ # # ### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): m You moved down! ##### s # #@### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You can't move right! ##### s # #@### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): j You can't move left! ##### s # #@### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): i You moved up! ##### s@ # # ### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): j You moved to the left! ##### @ # # ### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ##### s@ # # ### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): m You moved down! ##### s # #@### # e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): m You moved down! ##### s # # ### #@ e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): m You can't move down! ##### s # # ### #@ e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ##### s # # ### # @ e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ##### s # # ### # @e ##### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ##### s # # ### # @ ##### You win! Sample Run #1 What dimension shall we use for the maze? 7 ####### # # e # ### # # # # # @ # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): r That input is not valid. Please try again. ####### # # e # ### # # # # # @ # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ####### # # e # ### # # # # # s@# # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You can't move right! ####### # # e # ### # # # # # s@# # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): i You moved up! ####### # # e # ### # #@# # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): i You moved up! ####### # # e #@### # # # # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): i You moved up! ####### #@ # e # ### # # # # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ####### # @ # e # ### # # # # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You moved to the right! ####### # @# e # ### # # # # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): m You can't move down! ####### # @# e # ### # # # # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): k You can't move right! ####### # @# e # ### # # # # # s # # # # # ####### Make your move. (i = up, m = down, j = left, k = right, q = quit): q You quit before exiting the maze! Better luck next time. .žØ š š ņ ų ś ę ģ h   ¹  psų'!5L{™…›rŪ±ėīWeJQx†°²³öłś=÷ī÷ęāęāŽŌŽāĶāęāĶāĘāĶāĶāŗāŗāĶāŗāęāĶāęāĘāę­ —ŒyŒhŲW«OJQJhŲW«6OJQJ\hŲW«5OJQJ\hŲW«OJQJ\hŲW«6OJQJ]^JhŲW«5OJQJ\^JhŲW«CJOJQJaJ hŲW«6] hŲW«5\hĻMŚhĻMŚ56hĻMŚhŲW«hŲW«5>*\hŲW«5CJ\hŲW«5CJ \/.AmžØß1 ‹ Œ  š Ń Ņ f g h   i j ø ¹  É Ź 56Lśśśśśųóóóóóóóóóóóóóóóóóóóóóó$a$$a$l3žLM`a÷ų'hiŽęēōõ ¶·¶·ź  !5śśśśśśśśśśśśśśśśśśśśśīīśśśś $ & F ĘŠa$$a$5?@2LMz{‡“™šƒ„…›qrŪÜ›śśśśśśśśśśśśśśśśśśśīį×įī ĘŠ„h^„h $ ĘŠ„h^„ha$ $ & F Ęha$$a$›œ±UVWewx†²³łś?@…†«¬²ø¾ÄŹĖööńåńńńńńććććććććććććććććć $ & F ĘŠa$$a$$ Ęha$=?@ƒ…ĖŁetž ’ ī!"<"?"H#$$#$ %%8%F%p%r%¹%»%& &œ&ž&''‹''( (‚(„(ö(ų(s)u)ń)ó)g*i*Ż*ß*X+Z+Ö+Ų+öīćŲćŠĆ¶ćŠĆ¶ćŠ²Š²«²«²Š²¤²Š™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™Ž™ŽhŲW«6OJQJ]hŲW«5OJQJ\ hŲW«6] hŲW«5\hŲW«hŲW«6OJQJ]^JhŲW«5OJQJ\^JhŲW«5>*\hŲW«6OJQJ]hŲW«5OJQJ\hŲW«OJQJhŲW«6OJQJ8ĖŁ+,4<DLT\deft ”ĘĒĻ×ßēļ÷’ ķ!żżżżżżżżżżżżżżżżżżżżżżżżżżżų$a$ķ!ī!"¦"$$#$7%8%F%r%s%»%¼%Ā%Č%Ī%Ō%Ś%Ū%ė% &!&9&:&@&F&śśīāśśśśąąąąąąąąąąąąąąąąąą $ & F ĘŠa$ $ & F ĘŠa$$a$F&L&R&X&Y&i&ž&Ÿ&²&³&¹&æ&Å&Ė&Ń&Ņ&ā&''(')'/'5';'A'G'H'X''Ž'żżżżżżżżżżżżżżżżżżżżżżżżżżżżżŽ'¤'„'«'±'·'½'Ć'Ä'Ō' ( (( (&(,(2(8(>(?(O(„(…(“(”(š( (¦(¬(²(żżżżżżżżżżżżżżżżżżżżżżżżżżżżż²(³(Ć(ų(ł())))#)))/)0)@)u)v)Ž))•)›)”)§)­)®)¾)ó)ō)** *żżżżżżżżżżżżżżżżżżżżżżżżżżżżż ****#*$*4*i*j*z*{**‡**“*™*š*Ŗ*ß*ą*õ*ö*ü*+++++%+Z+żżżżżżżżżżżżżżżżżżżżżżżżżżżżżZ+[+s+t+z+€+†+Œ+’+“+£+Ų+Ł+ń+ņ+ų+ž+, ,,,!,V,W,o,p,v,|,‚,ˆ,żżżżżżżżżżżżżżżżżżżżżżżżżżżżżŲ+T,V,›,©,Ó,Õ,R-T-ż-’-•.—.+/-/¹/»/G0I0Õ0×0m1o122š2œ20323l3õźõŽõźõźõźõźõźõźõźõźõźõźõźõźõhŲW«5>*OJQJ\hŲW«6OJQJ]hŲW«5OJQJ\ˆ,Ž,,˜,™,š,›,©,Õ,Ö,Ž,ę,ī,ö,ž,----T-U-€--‰-‘-™-”-©-±-¹-żżżżżżżżżżżżżżżżżżżżżżżżżżżżż¹-ŗ-Ź-’-...!.).1.9.A.I.Q.R.b.—.˜.®.Æ.·.æ.Ē.Ļ.×.ß.ē.č.ų.-/żżżżżżżżżżżżżżżżżżżżżżżżżżżżż-/./2F2N2V2W2g2œ22³2“2¼2Ä2Ģ2Ō2Ü2ä2żżżżżżżżżżżżżżżżżżżżżżżżżżżżżä2ģ2ķ2ż22333l3żżżżżż/1h;0°Š/ °ą=!°"°# $ %°°Š°Š Š†œd@ń’d Normal$*$1$A$a$+B*CJOJPJQJ^J_HaJmH sH tHDAņ’”D Default Paragraph FontVi@ó’³V  Table Normal :V ö4Ö4Ö laö (k@ō’Į(No List >žOņ’ń> WW8Num3z0CJOJQJ^JaJJžOņ’J Absatz-StandardschriftartPžOņ’P WW-Absatz-StandardschriftartRžOņ’!R WW-Absatz-Standardschriftart1TžOņ’1T WW-Absatz-Standardschriftart11>žOņ’A> WW8Num5z0CJOJQJ^JaJVžOņ’QV WW-Absatz-Standardschriftart111XžOņ’aX WW-Absatz-Standardschriftart1111DA@ņ’qD Default Paragraph Font:žOņ’: Numbering Symbols>žOņ’‘> BulletsCJOJPJQJ^JaJNžO²N Heading ¤š¤x$CJOJPJQJ^JaJ6B@²6 Body Text ¤¤x$/@±Ā$ ListD"@ŅD Caption ¤x¤x $6CJ]aJ*žOā* Index $l+^’’’’l+.AmžØß1‹ŒšŃŅfgh ijø¹ÉŹ56LM`an+Ą!¼Ą!„Ą!„Ą!„Ą!¼Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬Ą!¬.AmžØß1‹ŒšŃŅfgh ijø¹ÉŹ56LM`a÷ų' h i  Ž ę ē ō õ  ¶ · ¶ · ź   !5?@2LMz{‡“™šƒ„…›qrŪÜ›œ±UVWewx†²³łś?@…†«¬²ø¾ÄŹĖŁ+,4<DLT\deft ”ĘĒĻ×ßēļ÷’ķī¦#78Frs»¼ĀČĪŌŚŪė !9:@FLRXYižŸ²³¹æÅĖŃŅā()/5;AGHXŽ¤„«±·½ĆÄŌ  & , 2 8 > ? O „ … “ ” š   ¦ ¬ ² ³ Ć ų ł !!!!#!)!/!0!@!u!v!Ž!!•!›!”!§!­!®!¾!ó!ō!"" """"#"$"4"i"j"z"{""‡""“"™"š"Ŗ"ß"ą"õ"ö"ü"#####%#Z#[#s#t#z#€#†#Œ#’#“#£#Ų#Ł#ń#ņ#ų#ž#$ $$$!$V$W$o$p$v$|$‚$ˆ$Ž$$˜$™$š$›$©$Õ$Ö$Ž$ę$ī$ö$ž$%%%%T%U%€%%‰%‘%™%”%©%±%¹%ŗ%Ź%’%&&&!&)&1&9&A&I&Q&R&b&—&˜&®&Æ&·&æ&Ē&Ļ&×&ß&ē&č&ų&-'.'<'='E'M'U']'e'm'u'v'†'»'¼'Ź'Ė'Ó'Ū'ć'ė'ó'ū'(((I(J(X(Y(a(i(q(y((‰(‘(’(¢(×(Ų(š(ń(ł() )))!)))*):)o)p)ˆ)‰)‘)™)”)©)±)¹)Į)Ā)Ņ)****&*.*6*>*F*N*V*W*g*œ**³*“*¼*Ä*Ģ*Ō*Ü*ä*ģ*ķ*ż*2+3+n+˜0€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜ 0€€€˜ 0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜ 0€€˜0€€˜0€€˜0€€˜ 0€€˜0€€˜0€€˜0€€˜ 0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜ 0€€˜ 0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€˜0€€=Ų+l3 (L5›Ėķ!F&Ž'²( *Z+ˆ,¹--/Y0”1ä2l3!"#$%&')*+,-.l3bgņųōž $.ż@J‡ŠQ\4>eot~ĄŹāģ+ 6 i l m x … ˆ õ   u { + , u € CNøĆ"-ŠŚr|~‰‹–˜¬®¼¾ŠŅŚ.8ƒŽklģķjkœćäYZÕÖP Q ‚ ƒ Ä Å A!B!æ!Ą!5"6"«"¬"&#'#¤#„#"$#$ %!%Ė%Ģ%c&d&ł&ś&+','‡'ˆ'¹'ŗ'((G(H(£(¤(;)<)Ó)Ō)h*i*ž*’*n+_aņžV]ĄŹi l ś  l t ź ė   HO½Ä‚'. ±²³Įś@N²³ĀĆ45Z[ĻŠsŅÓ@APQ¹ŗÉŹ/0?@«¬»¼& ' 6 7 š › Ŗ « '!(!•!–!„!¦! " """"‚"Ž"’"ü"ż" # #z#{#ų#ł#$ $v$w$]'^'ė'ģ'b(f(y(z())‘)•)©)Ŗ)&***>*?*¼*Ą*Ō*Õ*n+333333333333333333333333333333333333333333333333333333333333333šśk+n+n+’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’„Š„˜žĘŠ^„Š`„˜ž.„Š„˜žĘŠ^„Š`„˜ž.„h„˜žĘh^„h`„˜žCJOJQJ^JaJ-š„Š„˜žĘŠ^„Š`„˜žCJOJQJ^JaJ-š„8„˜žĘ8^„8`„˜žCJOJQJ^JaJ-š„ „˜žĘ ^„ `„˜žCJOJQJ^JaJ-š„„˜žĘ^„`„˜žCJOJQJ^JaJ-š„p„˜žĘp^„p`„˜žCJOJQJ^JaJ-š„Ų „˜žĘŲ ^„Ų `„˜žCJOJQJ^JaJ-š„@ „˜žĘ@ ^„@ `„˜žCJOJQJ^JaJ-š„Ø „˜žĘØ ^„Ø `„˜žCJOJQJ^JaJ-š„Š„˜žĘŠ^„Š`„˜ž.)„8„˜žĘ8^„8`„˜ž.„ „˜žĘ ^„ `„˜ž.„„˜žĘ^„`„˜ž.„p„˜žĘp^„p`„˜ž.„Ų „˜žĘŲ ^„Ų `„˜ž.„@ „˜žĘ@ ^„@ `„˜ž.„Ø „˜žĘØ ^„Ø `„˜ž.„„˜žĘ^„`„˜ž.’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’„„Ę^„`„’’’’’’’’’’’’’’’’’’’’’’WW8Num1WW8Num2WW8Num3WW8Num4’’åŲW«ĻMŚ’@€KKģņEKKl+`@’’Unknown’’’’’’’’’’’’ G‡z €’Times New Roman5€Symbol3& ‡z €’Arialk€Courier 10 PitchArial Unicode MS?5 ‡z €’Courier Newo€Nimbus Roman No9 LArial Unicode MS_ StarSymbolArial Unicode MSO&Nimbus Sans LArial?DejaVu SansBAˆŠhj ¢f£ŹŖf‚kF{ń$ƒN{ń$N!24dV+V+ÜHP)š’?’’’’’’’’’’’’’’’’’’’’’ĻMŚ²’’Introduction to C - Program 1dmarino Arup Guha      ž’ą…ŸņłOh«‘+'³Ł0t* ØŠÜģų (4 T ` l x„Œ”œ¤ä Introduction to C - Program 1dmarinoNormal Arup Guha2Microsoft Office Word@FĆ#@ÜL2 ćW+ģČDue: 11/10/06 (Friday) at 3:00am WebCT TimetTA4';: ;: ;;'G3!@;;';';'::;`u4ATNN!`4 2 ć”ģČ ?R2 ji/ģČNote: There are two parts to this assignment!!!T;'4'NA434;34&U:A;4&.';'@!.:.-!:@`4A'''' 2 j‚ģČ ?- 2 ö ģČ Hūœ’¼@Times New Roman-2 yī ģČObjective N8!,,!2,ü- @ !š š„īü’’’-š 2 yˆģČ 7ūœ’@Times New Roman->2 źī"ģČ1. To learn how to manipulate one2=2,,!222H2N,222,,22, 2 źeģČ-!(2 ź†ģČdimensional arrays.c2N,2'22,-!!.0' 2 ź• ģČ .=2 ]ī!ģČ2. To give students experience ue2=212,'22,2',32-!,2,,222 ]ģČsing #include with project'3122,22,H22!2,, 2 ]& ģČ-!+2 ]G ģČspecific source filese'2-,!,'22",,!,' 2 ]bģČ -^2 Šī7ģČ3. To give students experience integrating special pre2=212,'22,2',32-!,2,,2-2!,21'3,,,2!, 2 Š[ ģČ-!=2 Š| !ģČwritten functions into their codeeI!,2!22,22'222,!,22, 2 ŠģČ . 2 CīģČ - 2 ¶īģČ --2 +ī ģČDeliverablesH,2,,28,'ü- @ !š 6ī-š 2 +żģČ 7-Œ2 œīVģČAlthough there are two parts to this program, you only need to turn in one source fileH22212$2,",$,!,$H2%2,!'$2$2'$2!21!,N&122$22/$3,,2$2$2!2$2$22,$'22!,,$!,2 œäģČ, ūœ’¼@Times New Roman-2  īģČmaze.cO2',,-2  ģČ, "2  :ģČthat encompasse2,,2,2N2,''-n2  ĶBģČs both parts of the program (since the second part of the program '2222,!'2"2,2!32!-N!'2,,2-',,2232,!2!2,2!32!,Oj2 ‚ ī?ģČincorporates the first part anyway). We have divided this write2,2!22!,,(92,9!!'93,!9,40I.0!9_,93,2-9222,292'9H!, 2 ‚ Ų ģČ-!&2 ‚ ł ģČup into two parts 22:229H292,!(X2 õ ī3ģČprimarily to assist in its readability and clarity.2!N,!02,'''2'!,,2,20,22,-!0 2 õ 7 ģČ . 2 h īģČ --)2 Ū īģČAlso, note that you H'222,2, 022-2 Ū ģČcannot,2882!-72 Ū 8ģČ modify maze_gen.c or maze_geN22"0N,-,31,2,2"N,-,21,42 Ū e ģČn.h!! When we compile your g23!!_2,2H-,2N2, 022"m2 N īAģČprogram, we will use our original copies of those files to do so! 2!22!,NH,H2',22"2!12,,22,'2!22',",'222'2! 2 N Ö ģČ - 2 Į īģČ - 2 4 īģČ --^2 © ī7ģČProblem A: Display a 2D Maze from a 1D Character Array<,28-SH!H'82222H^2,,",3R23HH82,2,!-,H-,22ü- @ !š ü “ ī-š 2 © ź ģČ 7-F2  ī'ģČIn this program, you will declare a one 22'2!32!,N022H2,,,",,23, 2  ģČ-!L2  * +ģČdimensional array of characters, call a pret2N,2'23,,!".02!,3,!-,,!',,,2!, 2  ĮģČ-!2  āģČwritten I!,22  ī ģČfunction that !22,222,2  ģMģČ creates an ASCII maze and saves it in your array, and then display the maze ,!,,,',2H8D N,-,,22',2,'2/23!,!".0,222,22'2-02,N,-,2 īģČin two2H2 2 ėģČ-!2   ģČdimensions.2N,2'22' 2 ķģČ - 2 sīģČ -2 ęīMģČThere will be three steps to this first problem, and they are outlined below:=2,!,H2,2",,',2'22'!!'2!22,N,222-0,!,222,22,2H 2 ę™ģČ . 2 YīģČ --+2 ĪīģČa.) Including the pre 2!'8,8882!8,8,, 2 ĪWģČ-!^2 Īx7ģČwritten maze creation function and supporting functionsI+!!,8R2,,,-,2!28"87,!28288'8782,!82!78,!28' 2 ĪćģČ 6-2 ?īģČDoH2ƒ2 ?hPģČwnload both maze_gen.c and maze_gen.h from the course assignments page and save H22,2222N,-,22-2,,22N,-,31,22!!3N2,,22!',,''12N,2'2,2,,22',3,2 ²īXģČthem in the working directory where you will be compiling and running the code for this 2,N22,H2!2212!,,2"0H3,!,022H2,,2N221,22!222212,,22,!2!2&.2 %īģČprogramming assignment.2!22!,NN21,''12O,2 2 %ģČ - 2 ˜īģČ -j2 ī?ģČAt the top of your code, just after your #include staH62,62263!8022"6,32,62'6,!,!8023!622-22,68'22286',)2 Ę ģČtement, include the ,N,362,22,62-.2 ~īģČfollowing line of code:!22H212,2!,22, 2 ~ģČ . 2 ńīģČ -+2 dīģČ#include “maze_gen.c”e22,22,,N,-,31,2-, 2 d’ģČ . 2 ×īģČ -Œ2 JīVģČThis will include a number of functions used to create an nxn square ASCII maze. Most =2'H2,22,,22N1,!2!!22,22'2',22,!,,,,2232'22,!,H8C! N,-,Y2'•2 ½ī\ģČof these are just functions that support the creation of ASCII mazes, and you don't need to 2!2,',-!,2'!23,22'2,'2222!2,,",,322!H8D! N,-,',221222223,,232 0ī ģČknow anyth222H0,302w2 0ŁHģČing about them. You will, however, need to use one particular function: 310,22202,N0H220H022H,2,!02,,20202',022,02,!,2,!0!22,22 2 £īģČmaze_create().N,-,2,!,,,!! 2 £<ģČ . 2 īģČ -‰2 ‰īTģČIf you have trouble with the #include statement, you may want to make sure that you !)022'3,2,'!222,'H3'2,'22,22,'',,N,2(022'N./(H,2'2'N,2-''2!,'2,(022‰2 üīTģČhave the files saved in the right directory, double check that you are using “quotes2,2, 2, !,' ',2,2 2 2, !12 2!-,2#0 2222, ,2,,2 2,"022 ,", 2'21 ,222,(2 ü!ģČ” and , ,23-ČČģģĒĒėėĘĘźźÅÅééÄÄččĆĆēēĀĀęęĮĮååĄĄää æ æć ć  ¾ ¾ā ā  ½ ½į į  ¼ ¼ą ą  » »ß ß ŗŗŽŽ¹¹ŻŻøøÜÜ··ŪŪ¶¶ŚŚž’ÕĶ՜.“—+,ł®0 hp|„Œ” œ¤¬“ ¼ ęäUCFNV+Ø Introduction to C - Program 1 Title  !"#$%&'()*+,-./ž’’’1234567ž’’’9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdž’’’fghijklmnopqrstuvwxyzž’’’|}~€‚ž’’’ż’’’ż’’’†ž’’’ž’’’ž’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’Root Entry’’’’’’’’ ĄFĄśDÅBųĘˆ€Data ’’’’’’’’’’’’01Table’’’’8'YWordDocument’’’’1^SummaryInformation(’’’’’’’’’’’’e¤*DocumentSummaryInformation8’’’’’’’’{CompObj’’’’’’’’’’’’q’’’’’’’’’’’’ž’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ž’ ’’’’ ĄFMicrosoft Office Word Document MSWordDocWord.Document.8ō9²q