This is an old guide I made about a year or so ago and today I have decided to clean it up a bit and make it better. This guide should go according to Python 2.6. I would update this guide but, I have not used Python since (Anyone wanting to alter this guide and make it compatible for 3.0 is welcome. Send me a PM with the changes and I will include credits).
Alright, so you came here for either two things; A) Your looking to become a programmer, or B) Your taking some unwanted programming classes and you need to learn something quick. Either way, I am going to show you the basic fundamentals between some different programming languages and how they work. So, in a way this would be your basic introduction to programming theory as well. I am sure you have spent a lot of time trying to read guides and coding books that didn't work out as planned. Maybe every time you got a book you would get sick of reading it and you started to think, "I'll never learn to code", or maybe you have motivation but you just don't understand any of that "gibberish" that is described in those books. Well, I am here to kind of clear that up for you and make it easier for you to understand the basics so you can attempt to read from more advanced books. Now, that we have that out of the way, lets continue on to what you need.
[Requirements & Recommendations]
- [Requirements]
- A Programming Compiler (C++, Python, Visual Basic, etc)
I recommend that you read some if not all the contents that are attached to this guide, they hold vast amounts of information and are really good to read. I have read them all and I definitely recommend it people looking to get inspiration. You should start with Python to get the feeling of how coding works and to really understand how it all works. If you want to become a game programmer then you should quickly move on to C++ when you are ready. Now if you plan on reading everything I told you to read then Kudos to you, if not I really recommend that you do.
- [Recommendations]
- Read this guide carefully. Read it again if you don't understand it.
- Have a reference guide when coding, like a programming book of your choice.
- Visit some if not all of the links that I have posted in this guide.
If you do not like reading, you should stop now or just grind through it because their is a lot of reading associated with this guide. I have always said, "Failure's do not become successor's because they do not apply the tools around them. - Donovan Simon". Let's move on to the contents of this guide.
[Contents]
Folder: Become a Programmer
- Linux Related
This folder has a lot of information about Unix and Linux. If you are interested in either of them, then you should start their. These are some good things to know when wanting to become a programmer.
- HTML Related
This folder has a few topics about HTML. I have not read this folder yet but, I know they have some good free tutorials and some information that could be useful for HTML beginners.
- Software Related
This is just about software. The only guide in it at the moment is, "Software Releases". It explains what you should do when you release new software and what you should think about when releasing new patches or versions for that software.
- Cultural and Informational
This folder has some information about the programming community. Some terms that you will find a lot of programmers use and things that the programming community like and dislike. This is what motivated me in becoming a programmer and I think it will help you as well. I recommend you read everything in this folder. Once you do you will have some information about the programing culture and community. You might even gain some more respect from people around the community for taking the time out to read into it and know more about it. Knowing programming is one thing but, knowing how it work, where it came from, and the history is really good to know.
- Learning to Program
This folder has a web page that talks all about programming. The Python documentation is there for you to read all about python. Please Note: Some of the contents may not be fully published.
[Python Basics]
Lets start off with simple calculations. If you would like you can open python 2.6 and begin. If you learn these three things you should be able to open Python and begin basic coding without any worries or confusion. You might not be able to code your program to do everything you want it to do but, you will be able to do some basic stuff.
Lets say you wanted to add the variable health in your game. Then, you also implement a ring that adds +5 to the players health. You would have to define your variable health with a numerical value that associates it with the users health points. In this case we will use the 100. You then create a variable ring which is equal to the variable of health + 5. Usually people will define all there items and variables in the beginning. Which is why you would normally write the story line of a game first before coding it.
- Defining a Variable
If you loaded that script in the Python 2.6 console, it would look something like this;Code:Health = 100 Ring = health + 5 print "Welcome to 'THE GAME' your health is", Health
Code:Welcome to 'THE GAME' your health is 100 >>>
The chevron (>>>) symbol indicates that you are at the end of scripts simulations. You can make continuous loops, or menus that do not end a game unless otherwise authorized by the user as well. So, those are the basics to defining a variable. Variables are used in games to define how many bag slots are left, what time it is on the game, and various other things.
[User Input]
This is where you learn how to implement the action or interacting parts of your program. This is key when making a game, the more interaction the user has with the game the more entertainment he or she will have while playing. In this example we ask the user a question and store the users input in a data stream known as raw_input.
Code:Health = 100 Ring = health + 5 print "Welcome to 'THE GAME' your health is", Health Name = raw_input("\nWhat is your name?: ") print "\nNice to meet you", Name
With that out of the way, lets continue to another example below.
Code:Balance = 1000 print "Welcome to 'The Bank System' you balance is", Balance Withdraw = input("Withdraw Amount: ") Balance -= Withdraw print "\nYour current balance is now: $", Balance Withdraw = input("Withdraw Amount: ") Balance -= Withdraw
[If & Else Statements]
Here is an example of the If and Else statement, the If and Else statements can be used for allowing multiple decisions or actions to be made, checking, sending, or receiving information, and plenty of other useful tasks. Here is an example of these very statements at work.
Code:Balance = 1000 Withdraw = 0 print "Welcome to 'The Bank System' you balance is", Balance Withdraw = input("Withdraw Amount: ") if Balance == 0: print "\nYour out of money!" if Withdraw > Balance: print "\nYou do not have that much!" Withdraw = input("Withdraw Amount: ") Balance -= Withdraw print "\nYour current balance is now,", Balance
Well, thank you for taking the time out to read my programming guide but, most of all you should be thanking yourself for taking that first step. I have provided some extra resources and information below that can further assist you with anything you may need as a beginner.
Code:[CODING TIPS] Name Spaces: Name spaces or line spaces are often used to create a new line within code. In order to do this, simply add, "\n" right before the sentence you want to be on the next line. Printing Messages: Printing message or sending output to the user is also simple. Just use this code, "print "My Message!" Displaying Variables in Messages: Displaying or defining variables in messages is also quite simple, just experiment with the example code below and you will get the hang of it. Example 1: print "Welcome to the bank, your balance is: ", pBalance Example 2: print "Welcome ", pName ", to Cosco." Example 3: print "Welcome ", pName sName = Cosco ", to ", sName "." These are just a few examples on how this works. Variable1 > Variable2: If Variable1 is greater than Variable2 I.E: Quarter > Dime Variable1 -= Variable2: I do not know how to make this into a definition but, this will make it so you do not have to add another Variable2 and rename it to variable3 when doing a calculation. Like shown above. Variable1 = Value: Defines the value of a variable. I.E: Variable1 = 1 Variable1 = Variable2 - Variable3: A variable that is equal to a negative variable equation. I.E: Broke = Person - Money Variable1 = Variable2 + Variable3: A variable that is equal to an additional variable equation. I.E: Rich = Person + Money Remember: code is case sensitive, so if anything does not match you will have errors in your code.
[Downloads and Resources]
• Gzipped source tar ball (2.6) (sig)
• Bzipped source tar ball (2.6) (sig)
• Windows x86 MSI Installer (2.6) (sig)
• Windows AMD64 MSI Installer (2.6) (sig)
• Max Installer disc image (2.6) (sig)
Excellent Python Guide: Here
Last edited by Roger; 05-28-2011 at 03:20 PM.
I know this is not perfect code. I just wanted to point out some basic things for users. Do not always follow this code by heart. Later on in coding you will learn easier ways to code things properly. This is just something you can learn with as a beginner.
Nice tutorial, and I liked how you added other information to be downloaded! I don't know Python, though
+rep![]()
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Thanks for the reputation guys. Please make sure to visit Python Programming - Wikibooks, collection of open-content textbooks as stated in the guideVery good resource for python.
Credits to Steve.L for linking me this site![]()
Some of the articles on that site aren't even written yet lol. But a lot of the content is fairly decent and easy to understand, and backed by some good examples.
Great work mate! Fairly detailed and I will be downloading that file as soon as I +rep you![]()
I can see you will be noticed by the CC community REALLY quickly!
jQuery Selectors Tutorial - jQuery Striped Table tutorial - jQuery Events - jQuery Validation
Sorry if I don't post as often as I did, I'll try to get here as much as possible! I'm working my bum off to get this scholarship and other stuff!
Thank you guysThis is my goal to make some very good guides on CC and to become a very good fluent programmer in at least 5 languages
![]()
Time, effort and commitment will get you to your goal![]()
jQuery Selectors Tutorial - jQuery Striped Table tutorial - jQuery Events - jQuery Validation
Sorry if I don't post as often as I did, I'll try to get here as much as possible! I'm working my bum off to get this scholarship and other stuff!
I think I have the time, I know I have the commitment.. But I hope people do not think I am going overboard on posting. So I am going to tone it down a bit lol.. So I am going to keep on average about 5 - 10 posts a day.
Overboard on posting?
CodeCall began in 2006. Since then, the total number of posts made on the entire forum is around 89%.
Over 9% of that entire total consists of my posts. And I only joined a few months ago.
That is overboard.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks