Updated README a bit

This commit is contained in:
Jack-Benny Persson 2015-10-17 20:25:36 +02:00
parent ad9b6457e0
commit a5333dcca0

View File

@ -5,3 +5,21 @@ this is to input data to for example the rectangle program and the triangle
program and save those numbers in shell variables and to able to extract the
triangle from the rectangle. To the input is expected to come from STDIN and
output goes to STDOUT. So all those programs can exchange numbers with pipes.
## Example ##
Let's assume we have a rectangle *a* with the base 4 cm and hight 7 cm. Inside
this rectangle is a triangle *b* with the base 3 cm and hight 3 cm. Now we can
remove the triangle area from the rectangle area with the following commands.
```
a=`echo "4 7" | rectangle`; b=`echo "3 3" | triangle`
echo "scale=3; $a - $b" | bc
```
And the result of this will be 23.500, the remaining area of the rectangle once
the triangle is removed.
## Compilation ##
The programs can be compiled all at once with `make all` or one program at a
time with for example `make circle`.