I got an A
in this course, all the source code and quiz in this course will published at this repo.
Course website shows here. Below shows the file structure, the folder pa[x]/backup
(x specific x_th project assignment) contains the complete code with grading_sctipt tested.
.
├── C/ # provided at Example: https://classes.soe.ucsc.edu/cse101/Winter22
├── C++/ # provided at Example: https://classes.soe.ucsc.edu/cse101/Winter22
├── pa1/ # List, C version
├── pa2/ # FindGraph, C version
├── pa3/ # FindComponents, C version
├── pa4/ # Matrix, C version
├── pa5/ # List, C++ version
├── pa6/ # Arithmetic, C++ version
├── pa7/ # Dictionary, C++ version
├── pa8/ # Order, C++ version
├── Pseudo-Code/ # provided at Example: https://classes.soe.ucsc.edu/cse101/Winter22
├── README.md
└── Resource/ # .pdf files: assignment description
Gradding script is posted at this repository.
To test the code by yourself, please follow the instruction following:
- clone this repository
git clone git@github.com:21wang12/UCSC-CSE101.git
- change your work directory to specific pa, please change
[x]
whith the number of pa you want to.
cd ./UCSC-CSE101/
cd ./pa[x]/
take pa1 as example
cd ./UCSC-CSE101/
cd ./pa1/
- download and run gradding script, please change
[x]
whith the number of pa you want to.
wget https://raw.githubusercontent.com/agavgavi/cse101-pt.w22/main/pa[x]/pa[x].sh -o pa[x].sh
chmod 777 ./pa[x].sh
./pa[x].sh
also, take pa1 as example
wget https://raw.githubusercontent.com/agavgavi/cse101-pt.w22/main/pa1/pa1.sh -o pa1.sh
chmod 777 ./pa1.sh
./pa1.sh
- submit
backup
folder & enjoy your project assignment😋.
Use blow command to get the PA you want to download
# Please specify x to which pa you want to install, eg: x=2 will download pa2
cd /cse101
wget -nH --cut-dirs=3 -e robots=off -r -R "index.html*,*.gif" https://classes.soe.ucsc.edu/cse101/Winter22/Examples/pa<x>/
# To download pa1 in winter22(current term) please run this command
cd /cse101
wget -nH --cut-dirs=3 -e robots=off -r -R "index.html*,*.gif" https://classes.soe.ucsc.edu/cse101/Winter22/Examples/pa1/
# To download pa1 in spring21(previous term) please run this command
cd /cse101
wget -nH --cut-dirs=3 -e robots=off -r -R "index.html*,*.gif" https://classes.soe.ucsc.edu/cse101/Spring21/Examples/pa1/
- Create a
launch.json
file under current work directory.vscode/
folder and edit it like this
{
"version": "0.2.0",
"configurations": [
{
"name": "pa2",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": ["in1","my-out1"],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
}
]
}
- In the Makefile under the specific Programming Assignment folder, add the -g option at the COMPILE line.
# Add -g parameter can create debug version
COMPILE = gcc -std=c17 -Wall -c -g
-
Compile the source code with command
$ make
, and the program you want to debug with will be produced containning debug infromation. -
In the VSCode editor, open the file you want to debug with(ie: in pa2, open the FindPath.c in the vscode editor, so
${fileDirname}/${fileBasenameNoExtension}
inlaunch.json
can find the FindPath program that you want to debug with) -
Click the
Run and Debug
button in the left column of VSCode, and click the start debuging button, then the program will be execute in debug mode.
Here is the screenshot shows the debug mode, this really bring more convience for debugging.