Please report any errors directly to us: email@example.com
A. Before You Start
We're going to start enforcing deadlines, so now is a good time to make sure you've turned in what you think.
glookup -tto check that you have submissions for everything at the times you expect.
git fetch originto make sure you have all the tags work in the central repository.
git tagto see what tags you have.
If you have a tag (say
hw1-2), then the command
git log -1 hw1-2 # That's a one, not an ell
will print the log message for that tag, which has a date and time.
- You can match up tags with glookup submissions by date.
After making sure that all current work in your local repository, you can check out any selected submission (say,
git checkout hw1-2
(It will tell you that you are in "detached head state", but that's normal. This will allow you to see what we received from you. Make sure you do
git statusto make sure that the files you are looking at have all been added to the repository, and aren't just files you created and never bothered to track.
- When finished looking, you can use 'git checkout' on the branch you came from to get back (be sure you do this, or you will commit and submit something random next time!)
- On your home machine or laptop make sure you have the latest version of
cs61b-software(do not do this on your instructional account; there should not be a
cs61b-softwaredirectory there. Just go into
cs61b-softwareand use the command
git pull --rebaseto get any updates we might have made.
B. Some Review
We'll start with some review exercises on the subjects of pointers and OOP:
C. Project 0
Take a look at the Mini Project 0 specification.
Set up your working directory with its files in the usual way (see the
instructions in the specification)
if you're not sure how. Take particular care about the
git push -u origin ... step, so that you don't end up trying to push to
our repository instead of yours.
In the directory
make to compile the Java files. If you run
java -ea cube.Main in
miniproj0 directory, you will see a (broken) GUI open, which will be updated as you make progresses in your project. To see an example, run the following to see a working version.
Take some time to toy around with the example.
To give you a glimpse of a typical workflow for projects, do the following steps:
- Go to instructions in the specification, and follow the first 5 instructions, reading the code as instructed. When reading a java File, do not try to digest the whole problem from top to bottom. Instead, first read the name of the class and defined methods to understand a big picture of what it is and what it does. Then, move onto learning what each method does. If you find some keywords that you do not understand (e.g. framework-specific classes and method calls), do not hesitate to look up Java documentation to figure out and make a note to yourself for a future reference by adding explanatory comments.
make checkto run the JUnit tests on your current code. All tests should fail now, but you will conquer each of them one by one.
CubeModel.java, figure out what kinds of instance variables are required. There is no hard and fast rules to this step, but you should be able to infer most of them by understanding the
Based on your analysis, declare the instance variables that
CubeModelrequires. Then, immediately add and commit the changes you just made.
git add CubeModel.java git commit -m "[Proj0] Add instance variables to CubeModel."
- Implement the default constructor (without any parameters) in CubeModel.java, initializing the necessary instance variables. Then, immediately add and commit the changes with a helpful and readable commit message.
- Repeat step 5 for
isPaintedFace. Make sure to add and commit the changes immedately for each method you implement.
make checkagain to see if you pass any of the tests.
checkinit4should pass. If not, make necessary changes until you pass those two tests. After the fix, remember to add and commit the changes.
git pushto save your work to the central repository.
There is nothing to submit for this lab.