LEX 24: Practice Lab Practical, part 2

Work on part B today. You may look back at the part A instructions from last session if you wish. Use your code from part A as a starting point for your work on part B. Commit to the same repo.

Remember that your goal is to demonstrate your ability to use all the tools we've discussed, as well as a sound and methodical approach to both developing software, ensuring its correctness and performance, and tracking down and fixing bugs.

You are NOT expected to complete all the tasks outlined. The scope of the tasks is purposefully more than we expect that you will be able to complete so you will be able to show us your tool use and process application before running out of things to work on.

Repository & Kanban board integration

IMPORTANT: Be sure to include a link to your kanban board in a file named kanban.txt and set the appropriate permissions so course staff can view it via the link. If the graders can't see your board they can't assess your work!

PART B: Added elements in our world

We add pyramids to our blocks world. Pyramids behave as follows:
  1. Each pyramid has a distinct number printed on it. If there are N pyramids in the world then pyramids are numbered -1 through -N. (Note: pyramid numbers are negative, block numbers are positive.)
  2. The robotic arm can pick up any pyramid.
  3. The robotic arm can pick up only one pyramid at a time.
  4. The robotic arm can place a pyramid on the table.
  5. The robotic arm can place a pyramid on an open block.
  6. Nothing can be on top of a pyramid, so every pyramid in always open. In particular:
    • The robotic arm cannot place a pyramid on a pyramid.
    • The robotic arm cannot place a block on a pyramid.
  7. The robotic arm cannot place a pyramid on a block that is not open.
  8. Initially all pyramids are on the table.

PART B: New code

A teammate of yours wrote some code to handle pyramids. They don't know how to use git, so they put their code on cerf.cse.buffalo.edu, outside the repo in /shared/projects/alphonce/CSE306/lex24.zip which contains:

	pyramid.c
	pyramid.h
	test1.c
	test2.c
      
Your first task is to add this code to your repo in a new branch, whose name must be 'pyramid'.

PART B: Fix code

Your teammate's code may or may not be correct, and may nor may not have memory leaks. You should compile test1.c and test2.c and run each one to get a sense of the behavior of the code. Fix this code so that it (a) has the intended behavior, (b) does not cause segmentation faults when run, and (c) does not leak memory.

Remember that your job is to demonstrate your facility in using appropriate tools: even if you spot a bug or memory leak directly, you are expected to show your development process (e.g. creating a branch, writing unit tests that reveal the bug, fixing the bug, then merging the branch, or using tools to capture and preserve "before" and "after" snapshots of memory usage).

PART B: Continue development

Continue development on the code to incorporate both blocks and pyramids into the world, taking care to ensure that all the rules are enforced (e.g. you cannot move anything on top of a pyramid).

Do not panic if you do not finish writing all of the code for this problem. Finishing the code is not the goal.