Commit Graph

8 Commits

Author SHA1 Message Date
Chris Proctor 384d3b8b17 Update assessment repsonding to git log 2024-03-01 20:45:43 -05:00
Chris Proctor 4fe9b95eda Add assessment 2024-03-01 20:39:18 -05:00
Cory a3bc21bee7 Checkpoint 3: Added 7 goals!
The most immediate thing that came to my mind with my experience with
OOP is how unused to thinking in that way and working with objects I am.
In yahtzee_goals.py, I don't know that it would have occurred to me to
create a class for each goal. I think I was thinking of objects pretty
literally as "things" one can do stuff to or with, e.g. dice that can be
rolled. Goals don't immediately jump out as me in the same way, which
perhaps highlights how my understanding of OOP probably still could be
further developed. I thought a bit more about the difference between
methods and functions as I worked through Yahtzee. They seem similar in
the sense that either can do things or return values, but methods are
more restrictive in that they're tied to particular objects/classes. I
had some difficulty when writing the GoalThreeOfAKind class since I kept
getting an error that the number of arguments being passed was wrong. I
"realized," in the sense that I eventually figured out through trial and
error, that self was being passed even if I didn't specify it should be.

I imagine if I were to try doing this in unit 1 or 2, instead of
treating the game as an object interacting with other objects (the dice
and goals), it'd probably be some sort of loop with functions being
called to mimic the methods and a declaration of a lot of global
variables to keep track of things like score, which goals have been
used, the faces of the dice, etc. I feel like with all these functions
and variables I might need to be more mindful with making sure to only
edit the things I don't need to keep track of if I were to go that
route. I think one thing that I'm realizing generally is that I need to
consider how best to use multiple files to write things in so that I can
focus on particular elements, e.g. goals vs. how the game plays. I hope
with more experience I'll get better at planning out how my projects can
be written/organized.
2024-02-12 13:52:53 -05:00
Cory 637a5e5191 Completed checkpoint 2.
Writing docstrings was different from writing code. One reason is that I
was trying to understand code I hadn't written, so it may not have been
written or presented in the way I would have conceived it. Similarly,
I didn't necessarily know how each method related to the other, so
instead of breaking down a problem into smaller ones, I was trying to
understand how all of the pieces came together to create a version of
Yahtzee. Another reason is that I don't write a lot of comments or
docstrings in my own practice, so it's something I need to build a
better habit of. I wasn't always sure if what I was writing captured
what I needed to in a docstring.

I do think in the future, I should write more docstrings, if not for
myself than at least to model it for my students. I think partially this
is because I usually write my projects in short bursts so the meaning
is clear to me. I can see how it might have value if it's something
others might look at or something I have to revisit later on after
having not looked at it for a while.
2024-02-12 12:09:14 -05:00
Cory efdf60db9c testing mwc 2024-02-12 10:12:39 -05:00
Cory 7c37816f42 testing mwc 2024-02-12 10:10:56 -05:00
Cory Dean Chung 80d5956eac Added methods to determine if there are at least n
of a kind in a roll of five dice.

Similar to what was done in this lab, classes could be used to
simulate coin tosses. I imagine then that simple board games
could be simulated easily using classes, too.
2024-02-02 19:37:05 -05:00
cchung 7fd9d0487e Initial commit 2023-08-16 05:28:24 +00:00