Bird is the Word

This is a pair exercise and must be competed in your tutorial or lab with your partner.

You should make sure you have completed your first C program before completing this task.

Now use the Linux command cp to copy bad_pun.c to a new file named bird.c, like this:

$ cp bad_pun.c bird.c

You are now ready to start editing the file bird.c using your favourite editor.

$ gedit bird.c &

Note that the basic structure of the program can be retained; you just need to change the comments, and modify and/or add printf statements to the program. Edit the file bird.c to produce a new program that behaves as follows:

$ dcc -o bird bird.c
$ ./bird
  ___
 ('v')
((___))
 ^   ^

Make sure you save your modified program before you compile it.

Make sure you re-compile your program every time you modify the code.

Handy Tip 5

Linux remembers the commands we have recently typed in. By pressing the UPARROW key, it will bring up your previous command and save you retyping it in! Try it. You can press the UPARROW key repeatedley to go back to the second last command, third last command and so on.

Handy Tip 6

At your Linux command prompt, type in ./b and then press the tab key. Linux will automatically try to fill in your partially typed command for you!

To run some simple automated tests:

$ 1511 autotest bird

To run Styl-o-matic:

$ 1511 stylomatic bird.c
Looks good!

You’ll get advice if you need to make changes to your code.

Submit your work with the give command, like so:

$ give cs1511 wk01_bird

Or, if you are working from home, upload the relevant file(s) to the wk01_bird activity on Give Online.