Posts

Showing posts with the label Coding

How to Build a Simple Hangman Game in Python, Beginner's Tutorial

Image
There's a lot of different ways to build a Hangman game in Python. but I think I've found a way that makes it a little simpler than the methods of looping through a string. I want to spend a bit of time going over the core concept before we really get into the code. You can follow along in an editor, but feel free to skip ahead. I'm going to show two ways of completing this game. First, we're going to let Python handle the work with the .find() method, then do the work manually by looping through the string while checking.  This tutorial isn't going to touch on anything like functions or classes, and it may get a little unpythonic because I want to keep things as simple as possible for now. This tutorial is assuming that you're already familiar with concepts like:   variables, lists,  indexing,  loops, if statements,  and basic math operators  But if you see anything you don't recognize, just Google it and come back. Websites like w3schools and geeksforgeek...

Python Institute PCEP Certified

Image
  I just passed my Python Institute PCEP certification! This was a very interesting test to take. In addition to understanding how the concepts work, each question is like a little puzzle and you have to try to piece together the snippets of code they present you.  I hope that this will help me in the future.

Simple TKinter Python Game Design Doc

Image
For this project I just jumped into the editor without any real plan in mind. The first thing I made was the splash screen. It’s a videogame, so why not make it look like a videogame? I clone-stamped the Legend of Zelda screen to clear a space for my own title, which I decided was Legend of Tkinter. I used the time.sleep method to create a little intro animation. I still had no plans.  Next up I clone stamped a screenshot of a Legend of Zelda level to make it more open and uniform, and I drew a little stick man in there as a protagonist. I cleared off the UI so I could put my own in there, and I made a little life counter by finding a heart in Character Map and setting a label to "♥" * lives, then I made a hurt function with a button that would -= the lives. Then I decided I needed a way to die. I made a game over screen, and I really, really wanted to draw a stickman doing the Family Guy death pose, but crossing his legs and feet like that created a very nasty symbol, ...