[Week 8] Classes and Projects

Overview

Today, we covered the advanced properties of classes. Specifically, we covered the def __init__ function and talked about how it can be used to setup an object when it is first created! To practice this, you created an class and object in class.

We talked about your projects and you made a flow-chart to plan what you will be doing. The projects all sounded really awesome and exciting!

Additional Guides

I have placed a few more guides onto the cookbook site (which, if you don’t remember, you can get to through the shortcut page I maintain hacs.club). Specifically, I added a couple ways of saving and loading files.

If you would like to know anything more or see detailed examples of something, please email me. The sooner you do this, the better!

At-Home Work

Over the next week, you should be working on your project. There is 2 weeks left until project presentations, so not everything needs to be done, but the more you get done, the better your project can be!

The project should have the following properties:

  1. Be text based
  2. Get input from the user
  3. Use that input to make decisions

The projects you have selected have all followed these criterion, so don’t forget that this is the core mission! If you get stuck on something hard, it’s also best to scale it back first and get it working. Complexity is much easier if you get a simple thing working first.

The tangible goal for next week is to have a minimal working example of your final project. It should be a very small example of what you want to make bigger. So, it should:

  1. Display to the user what the intention of the program is
  2. Get input from the usre and then use that input to progress your game, story, or program
  3. Provide at least 1 round of interaction
    • For the games, this could be 1 action by the user and the computer
    • For the stories, this could be 1 set of choices and/or scenes.
    • For the riddle/encoding, this could be 1 question.

If you want your project to have complex things about the user, try to focus on having only 1 or 2 things for now. The hardest part is getting the code in place to handle everything. And it is easier to do that when the amount of things it is handle is small.

If you want an online coding environment to place your demo, I would recommend either trinket.io or repl.it

Lecture Slides