![]() |
| Python code snippet |
Sunday, January 5, 2014
Python Programming
Practicing some Python programming. It's a lot easier than pretty much all other languages that I have tried, which are C/C++, Java, Javascript, Visual Basics, C#, and HTML5. What you're seeing below is a snippet of a very small program that I made using Python. It's only 92 lines of code and uses if/elif/else statements, a while loop, variables holding player and npc information, get input from the player, and uses random numbers. The code could be cleaner, I didn't write out what I was going to do before I started doing it, so it took twice as long as it should have and was kind of messy. I suggest anyone who codes to write in plain english what they want their program to do before they start working on it. You can usually figure out what methods, variables, and generally how you want to write the program. Trust me it simplifies things.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment