This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:spring2022:unix:projects:mtf0 [2021/10/04 15:05] – external edit 127.0.0.1 | haas:spring2022:unix:projects:mtf0 [2022/03/15 18:09] (current) – [sample outputs] wedge | ||
---|---|---|---|
Line 15: | Line 15: | ||
<cli> | <cli> | ||
- | | + | (10) |
| | ||
1 | 1 2 3 4 5 6 7 8 9 | 1 | 1 2 3 4 5 6 7 8 9 | ||
Line 34: | Line 34: | ||
While you've likely had little need, due to your solid memorization and recall, for years of the base 10 multiplication table, we're going to bring it back to the forefront, like many good mental aids, in that they make for excellent exercises to have the computer generate. | While you've likely had little need, due to your solid memorization and recall, for years of the base 10 multiplication table, we're going to bring it back to the forefront, like many good mental aids, in that they make for excellent exercises to have the computer generate. | ||
+ | =====grabit===== | ||
+ | Some projects encountered this semester, or in other classes that utilize lab46, will provide you resources that you can access via the ' | ||
+ | |||
+ | Using your investigative skills cultivated in this class, figure out how to use the **grabit** tool to obtain the project files provided for this project. | ||
+ | |||
+ | Do note: as an attempt to ensure some element of time management is practiced, you will want to perform this step by the Sunday prior to the due date of the project. | ||
=====Script===== | =====Script===== | ||
Your task for this project is to write a bash script to generate a multiplication table. | Your task for this project is to write a bash script to generate a multiplication table. | ||
Line 45: | Line 51: | ||
* the operation symbol represented in the top left of the table (in our case, an ' | * the operation symbol represented in the top left of the table (in our case, an ' | ||
* all values aligned, allowing for the padding of a single space for the largest value represented | * all values aligned, allowing for the padding of a single space for the largest value represented | ||
+ | * in the upper-left corner, in parentheses, | ||
Additionally, | Additionally, | ||
Line 52: | Line 59: | ||
* $3: the starting point (0-) | * $3: the starting point (0-) | ||
- | NOTE that the ending value comes before the starting value. | + | NOTE that the ending value comes before the starting value in the order of command-line arguments. |
=====Toolbox===== | =====Toolbox===== | ||
Line 73: | Line 80: | ||
====the shabang==== | ====the shabang==== | ||
- | One thing that makes a bash script an actual **bash** script is the shabang, a mechanism for ensuring our script is run using a particular shell. | + | One thing that makes a bash script an actual **bash** script is the shabang, a mechanism for ensuring our script is run using a particular shell or interpreter. |
The VERY FIRST LINE of our script, to set this up, will therefore be as follows: | The VERY FIRST LINE of our script, to set this up, will therefore be as follows: | ||
Line 88: | Line 95: | ||
</ | </ | ||
- | Your script will then occur between the shabang and this final exit command. | + | Your script will then occur between the shabang and this final exit command. Scripts lacking these two bounding elements will not be considered complete and will be subject to credit lost during evaluation. |
====for loops==== | ====for loops==== | ||
Line 133: | Line 140: | ||
The **printf** tool is an especially powerful output formatter. | The **printf** tool is an especially powerful output formatter. | ||
+ | =====sample outputs===== | ||
+ | For checking purposes, here are some sample outputs of what your script should be able to generated, given various command-line arguments: | ||
+ | |||
+ | Standard base 11 table: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | (11) 1 2 3 4 5 6 7 8 9 A | ||
+ | | ||
+ | 1 | 1 2 3 4 5 6 7 8 9 A | ||
+ | 2 | 2 4 6 8 A 11 13 15 17 19 | ||
+ | 3 | 3 6 9 11 14 17 1A 22 25 28 | ||
+ | 4 | 4 8 11 15 19 22 26 2A 33 37 | ||
+ | 5 | 5 A 14 19 23 28 32 37 41 46 | ||
+ | 6 | 6 11 17 22 28 33 39 44 4A 55 | ||
+ | 7 | 7 13 1A 26 32 39 45 51 58 64 | ||
+ | 8 | 8 15 22 2A 37 44 51 59 66 73 | ||
+ | 9 | 9 17 25 33 41 4A 58 66 74 82 | ||
+ | A | A 19 28 37 46 55 64 73 82 91 | ||
+ | </ | ||
+ | |||
+ | Subset of base 9: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | ( 9) 2 3 4 5 | ||
+ | | ||
+ | 2 | 4 6 8 11 | ||
+ | 3 | 6 10 13 16 | ||
+ | 4 | 8 13 17 22 | ||
+ | 5 | 11 16 22 27 | ||
+ | </ | ||
+ | |||
+ | Base 15: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | (15) 0 | ||
+ | x------------------------------------------------------------------------ | ||
+ | 0 | | ||
+ | 1 | | ||
+ | 2 | | ||
+ | 3 | | ||
+ | 4 | | ||
+ | 5 | | ||
+ | 6 | | ||
+ | 7 | | ||
+ | 8 | | ||
+ | 9 | | ||
+ | A | | ||
+ | B | | ||
+ | C | | ||
+ | D | | ||
+ | E | | ||
+ | 10 | | ||
+ | 11 | | ||
+ | 12 | | ||
+ | </ | ||
=====Submission===== | =====Submission===== | ||
To successfully complete this project, the following criteria must be met: | To successfully complete this project, the following criteria must be met: | ||
Line 145: | Line 210: | ||
* Submit a copy of your source code to me using the **submit** tool. | * Submit a copy of your source code to me using the **submit** tool. | ||
- | To submit this program to me using the **submit** tool, run the following command at your lab46 prompt: | + | To submit this program to me using the provided Makefile, run the following command at your lab46 prompt: |
<cli> | <cli> | ||
Line 183: | Line 248: | ||
*: | *: | ||
*: | *: | ||
- | *:mtf0:runtime | + | *: |
</ | </ | ||
Additionally: | Additionally: | ||
- | * Solutions not abiding by **SPIRIT** of project will be subject to a 25% overall deduction | + | * Solutions not abiding by **SPIRIT** of project will be subject to a 50% overall deduction |
* Solutions not utilizing descriptive why and how **COMMENTS** will be subject to a 25% overall deduction | * Solutions not utilizing descriptive why and how **COMMENTS** will be subject to a 25% overall deduction | ||
* Solutions not utilizing **INDENTATION** to promote scope and clarity will be subject to a 25% overall deduction | * Solutions not utilizing **INDENTATION** to promote scope and clarity will be subject to a 25% overall deduction | ||
* Solutions lacking **ORGANIZATION** ior are not easy to read (within 90 char width) are subject to a 25% overall deduction | * Solutions lacking **ORGANIZATION** ior are not easy to read (within 90 char width) are subject to a 25% overall deduction |