L1: Puzzle of grass, goat, lion CS1234: Small-Scale Application Development You are expected to code it up with either vi or emacs. + Use Ctrl-Alt-F3 to go to the terminal. + Login using your cs25b--- login and password. + Try various commands (pwd, ls, cd, cat). + Open emacs or vi editor and type the program. + Compile it with gcc and run ./a.out. + You can download this problem statement from the terminal: wget https://www.cse.iitm.ac.in/~rupesh/teaching/ssad/jan26/L1.txt + After the download: cat L1.txt Lab problem (to be submitted on moodle by 16:40). 1. Represent the state transition diagram in memory using structures and pointers. Take an input string on the command-line and print the state reached with that string. Assume boat capacity of 2. + For moodle submission, you can go back to the GUI using Ctrl-Alt-F2 or F7. + Slides are accessible from the course webpage: https://www.cse.iitm.ac.in/~rupesh/teaching/ssad/jan26/ Examples Input Output G_gGL_G final or |OgGL GG OgGL| GgG infeasible G_LLgG OGL|g _ unsafe or gGL|O Practice problems: 2. Extend the code to five entities (abcde). Assume capacity of 3. 3. Extend the code to work for arbitrary number of entities. Output the minimum capacity needed. 4. Extend the code to work with arbitrary eating structure (as defined in the slides). Devise how this eating structure will be given as an input to your program. Check that it works for the earlier problems.