Summary: a coding project, significantly building on the prior day’s discussion of basic oop concepts.

project: console Quiz Game (repo)

No real problems here, although I saw a lot of my fellow students bailed after this chapter.  To me it seems like a perfect introductory level walk-through of a modular OO program.  The challenges she gave us along the way were not difficult, and the rest of the time was basically like a pair-programming situation where she was intentionally directing the flow of development and we were coding together.

Cool day! We got off Replit and into PyCharm which I am loving. Although I actually would have preferred she moved us into vscode, this is a very nice IDE and the open source version is good enough for now. Definitely appreciating the speed of the code completion compared to replit which was constantly falling offline (I’m on wifi in the back of the building, but nothing falls off that much). Also loving how it sets up virtual environments per project automagically. Actually I really like that.

No new python, but another reverse engineering logic project.

project: Coffee Machine simulator (repo)

The end of the “Beginner” section of the course, today we were given a working program and told to break it down and re-write it from scratch. Looking forward to tomorrow where we move out of Replit. I think I’ve hit my limit of patience with a few of its quirks.

project: higher lower game (repo here)

No major problems . I planned by way of writing out the process in comments, which are documented as pseudocode in the repo. My final version was slightly different, but it marks the beginning point right before I wrote down any real code. An interesting artifact, and perhaps helpful to someone.

Moved some of the repeated code out of the main game loop (function) into separate functions. I was thinking of other ways to optimize this but it really isn’t that big of a deal.

Time to move on.

Efficiency hit. Had to work overnight all weekend. Been studying blockchain on the side, so still a win.

Summary: general tips for debugging and using a debugger with breakpoints.

No standalone final project, several coding exercises.

This was a very quick day for me, I should have just done it yesterday but I was wiped.

Summary: namespaces and scope, naming constants

Final project: guess the number game  (repo here)

Not a lot new here, I actually thought it was significantly easier than the blackjack game, so it was a nice reprieve. I wrote it without assistance again, so this version is my take on the solution as a first prototype. It works.

I feel like the penalize_player() function is kind of unnecessary, I only did it to avoid a couple of lines of repeated code, but that then necessitated rewriting all the turn count decrements as results of return rather than a direct decrement (which is easier to read). Whatever! Best number guessing game I’ve written in a while.

Also spent some time reviewing a roadmap toward hopeful freelance work in the blockchain space. I feel like I am incredibly late to the party, but there’s no time other than now. I can’t do anything about past decisions. So let’s do this. It does mean I have to add a javascript review (which I may do as part of another 100 days) as well as some serious react learning. (Maybe a CSS intensive also. I need enough to make a lightweight, responsive front-end and it isn’t completely foreign, it has just been a while and I really want to make sure to use the current thinking patterns as regards…well everything.)

Capstone project: a console blackjack game.

Relatively simple – does not account for splits, double down, insurance etc. Just 1 on 1 21.

Not sure why it won’t play from that embed page, replit has being acting weird all day as if I’m disconnecting and connecting from the internet frequently. Nothing else gives me that indication. So I eventually moved over to Thonny and finished it locally. It’s actually pretty fun and frustrating, so I am not upset.

I did this without using any of her hints, so I guess that makes this an “expert” level attempt. I would not call this an expert solution, but I guess I am pretty pleased that I can write a full console program with somewhat convoluted logic without referring to anything but the pydocs to see whether sum() was a method or a function. 🙂

I am going to go through now and watch how she did it, because I guarantee this is not the most elegant solution. Nevertheless rather than just commit her code instead of mine, I am committing mine as a snapshot of my thoughts and how I handle logic at this point in time.

I am also starting to commit some of the more interesting code snippets to another personal repo.

Summary: review functions with outputs, docstrings, function recursion

Learned that input() has a return, so can be used to make a loop flag without a separate variable.

final project: text-based 4 function calculator in the console

I wrote my fully functional prototype alone then watched her to look for improvement.

Had some issues with the bottom line of the web-based console in replit, but I confirmed that the issue was not my code by running the calculator locally.

We did this in different ways.  She had a separate micro function created for each operation, while I just passed the operator to the calculate function and had 4 returns.

Well, it ends up she was going to use this entire lesson as a teaching moment because she not so subtly immediately introduced mapping functions to other labels, which turned out to be a pretty cool way to use the typed in symbols.

The symbols themselves were keys mapped to the function names (no parens) in a dictionary. neat.

You can directly call the correct function by addressing the mapped function by passing the index symbol, rather than make a temporary function label as she did.

I feel a little weird wrapping the entire script into a function and then calling itself to loop. in BASIC you just GOTO 10, of course there’s nothing like that in python (labeled lines), but in this way the function name actually does act as a label that can be used to loop back and repeat.

Neat, I probably wouldn’t have thought to do that as the solution. Well obviously I did not, I had it wrapped differently in my original prototype.

Missed yesterday, not counting the day.  So this is now Sunday October, 7 2021.

Have been really getting side-interested in smart contracts. It surprises me that I’m actually open to working with crypto and defi now, even NFTs which part of me thinks are by and large ridiculous and as vacuous as the legion of  $#|tcoins.

I have actively avoided that knowledge domain (and thereby that devspace) for as long as I knew it existed. Anyway I digress. My prior notes reminded me. I’ve found some amazing assets to learn, but the first priority is finishing the python challenge.

So why am I not calling this day 9 like I have seen some people do on twitter? Well I’m not, I am calling it 8 because this is the 8th day of effort I’m putting toward this very specific #100DaysOfCode / #100DaysOfPython challenge. It would be worse for me to try to keep up with an offset than it is to just say “oops worked too hard building those wooden tables, didn’t drink enough water” (true) and do day 8 the next day. It’s my life, it’s my count, it’s my choice.

I also think this is the most sane way to handle #100DaysOfCode when you’re sometimes having to go out of town where there is no internet (truth). Sure you could fill those days with “i downloaded and watched some videos” or “i coded some local stuff” . Fine. But it is not the same level of effort and expectation as set forth by a complete curriculum.

I continue to digress….

summary: review functions with inputs, parameters, and arguments

Final project: Caesar Cipher encoder/decoder (console) 

Not the worst way to spend a Sunday.  So far 7 tomatoes, but I will probably start looking at the next cryptozombies lesson.  I really dove into the concept last night, after allowing myself to get over myself with regard to programming.

The stupid thing is I have the worst imposter syndrome. I have literally been coding like this since I was … what… 8 years old? I’ve gotten paid to code in everything from perl to COBOL (yes, actual COBOL on a mainframe with byte-wise raw storage io. holy crap). and yes, even python … but it has been a while.

I wrote an entire (garbage) CMS in 2005 because the client refused to listen to me tell him that WordPress would be more secure. It’s just been a while. I have hidden from the public eye for years, living very meagerly. But yeah, I need to start being who I actually am instead who I have been led to imagine myself to be.