summaryrefslogtreecommitdiff
path: root/20_rot_matrix/README
diff options
context:
space:
mode:
authorHaidong Ji2022-04-15 15:51:30 -0500
committerHaidong Ji2022-04-15 15:51:30 -0500
commit442a49ad5a48d417345959b903ae6a6d32d55759 (patch)
treec7127bb497e5e439018b1915e0136eec2c9cb124 /20_rot_matrix/README
Great C programming funHEADmaster
Excellent fundamentals and displine training, many tools and techniques exercises: gdb, emacs, valgrind, git
Diffstat (limited to '20_rot_matrix/README')
-rw-r--r--20_rot_matrix/README37
1 files changed, 37 insertions, 0 deletions
diff --git a/20_rot_matrix/README b/20_rot_matrix/README
new file mode 100644
index 0000000..8e0f90b
--- /dev/null
+++ b/20_rot_matrix/README
@@ -0,0 +1,37 @@
+For this problem, you will be writing a function which
+performs a 90 degree clockwise rotation of a 10x10 matrix.
+There is nothing special about a 10x10 matrix---we are just
+fixing the size so that you can read the input in a future
+assignment after you have learned about reading files,
+but before you have learned about dynamic memory allocation.
+
+In particular, you should write
+
+ void rotate(char matrix[10][10])
+
+in a file called rotate.c
+
+This function takes a 10 by 10 matrix of characters and rotates
+it 90 degrees clockwise, updating the matrix that was passed in
+(remember that arrays are pointers, so you will modify
+the array in the frame where it was created).
+
+As you have not yet learned to read from files, we have
+provided a compiled object file, read-matrix.o. This
+object file has a main function which will read
+the input file (specified as a command line arugments
+to your program), call your rotate function, and
+then print the result.
+
+If you compiled your code (and linked with read-matrix.o)
+into a program called rotate-matrix, you might run it as
+
+./rotate-matrix sample.txt
+
+It will then print the resulting matrix, which in this case
+should look like the contents of the file sample.out.
+(Remember that you can use > to redirect the output
+of a program to a file, and use diff to compare
+the contents of two files).
+
+Note that you do not have to complete the rotation 'in place'.