Commit Graph

4 Commits

Author SHA1 Message Date
Rebecca Hankey fb996aeba2 I made the computer deterministic and updated the
code to import the LookaheadStartegy to the class player.py.

As I worked through the lab I found myself coming back to the web that
was given to us in the lab itself. When I play games like Rumicube and
tic tac toe the process of running scenarios in my head happens instantaneously.
Prepping the computer to play this way as well is complex.

The reward system is a straightforward and interesting way to evaluate the "goodness" of
a move. How good is it to do one thing rather than another? The ability to think all the way through the
options is really interesting to evaluate and think about! Overall my cognition maybe did less in
the way of changing, but developed a meta-like awareness for the process it goes through when it's
problem solving.
2024-11-23 15:23:13 -05:00
Rebecca Hankey ec7b133190 I added a new method that would check for winning
combinations in the tic tac toe game, then completed the existing
method for checking the winner.

I outlined my strategy a little in the notes section as well, but like a lof of my code,
I plan on paper. It remainded me of the same thing I tell my students when they are writing an essay.
Even if it seems obvious, you have to tell the reader (or in theis case the computer) what you
mean. Or it will fill in the gaps based on what you already said, and that is how things get
misconstrude. I started by writing the ways that the game can end.

1. The board can be full and there is no winner.
2. X can will by getting three in a row; row, column, and diagonal.
3. 0 can win by getting three in a row; row, column, and diagonal.

The I elimated the options that are alread accounted for. We have a solution for when the
board is completely full, so there needs to be options to end the game when a winner actually
wins.

So, I listed the ways that you can win, the integer combos that are options for a win. I listed them
in order by the direction of the win. Row then column, then diagonal. Finally, I listed the steps that
I would need to add this to the code.

1. I needed to adjust the def_winner method to return something other than just false.
2. To make it able to tell True from False, I needed to tell it what was true; so I also would
have to list the combos that would win.
3. I need a new method that will check the board against the index provided in the def_winner method.
2024-11-23 14:09:33 -05:00
Rebecca Hankey 77aab6c085 I identified the classes needed to complete
the tasks in notes.md

The amount of code was difficult, but I watched the video beforehand and it really helped.
I found myself talking while the video was on and being able to identify the elements in real time
and before you mentioned them. My computational literacy in terms of actually being able to read
and decipher code is getting a lot better and these last two labs were a huge help in that process!

I want more of this! Given the desired objective and the code, with some errors, troubleshooting has been
an amazing learning experience. If I was teaching this as a class, it might be cool, at this point in the
curriculum to go back through the code that students had already written and do the same thing. Troubleshoot
something that we know already works and that we know the objective for.
2024-11-23 13:34:44 -05:00
rhankey 383ce469a9 Initial commit 2024-08-29 12:32:50 +00:00