Can't (or don't want to!) remember the name of that unix command? --
change it! Unix allows you to customize your environment using the
alias command. For example:
alias dir ls
would tell unix to run its
ls command whenever you type dir. It is very common to put a number
of such aliases in your .cshrc file. This is a file that is
automatically run each time you start up a new shell. It is common to
put aliases for common commands that set flags that you want (but that
are not set by default).
The following
are some of the aliases I have in my .cshrc file:
# some aliases
alias cp 'cp -i' # prompt before overwriting existing files
alias mv 'mv -i' # prompt before overwriting existing files
alias rm 'rm -i' # prompt before removing files
alias cd.. 'cd ..'
alias m more
You can change lots of things about the look of Unix in your .cshrc
file. For example, you might make your prompt the machine name,
the time, or a directory listing. Take a look in your default
.cshrc file and see if you can figure out how to change your
prompt to something else. Feel free to look in my .cshrc file
for more ideas! It should be readable.
Read: D&D, pp. 276-296, , pp. 320-329 (through 5.4)
Exercises: p. 309-310, 4.11 and a variant of 4.17 -- in addition to keeping the single subscripted array that the question requires, I would like you to keep track of the number of times each combination was rolled in a double subscripted array indexed by the value of each die. The row should hold the value for die 1 and the column the value of die 2. So, for example, if one of the rolls is a 3 on die one and a 2 on die two, you should add one to array_element[3][2] as well as to total[5]. Print out both of these arrays after doing all of the calculations.
EXTRA CREDIT HOMEWORK
Assume the following array declaration:
const int numb-rows = 10;
const int numb-cols = 5;
int a[numb-rows][numb-cols];
What is the formula for accessing array element a[i][j]?
Hint: remember C++ stores all of row 0 before row 1.