lbjoseph
Jun 30, 2011
=Basics of Programming= //[[user:lbjoseph]]// ---- =Introduction= [[toc]] I remember having the desire to learn programming when I was 12 - I just wanted to make my own games. Sound familiar? Thinking it would be educational, my mom bought me a copy of [[@http://www.libertybasic.com|Liberty BASIC]]. It was educational, mind you, but it was so engaging to me that she had a hard time getting me to do anything else for the next few years. Yes, I was a normal teenager and did things with friends, but most of my spare time alone was spent programming or reading about programming. Learning and experimenting pays off, however. As you can see, I am now writing this article to help //**you**// learn the basics of programming. ==The Problem With Programming Tutorials== If you try to find a good beginner's programming tutorial online, you'll usually run into one of the following problems: * They're not youth friendly. * They expect you to already know a different programming language. * They start by teaching very difficult and often boring programming languages. Instead, this tutorial tries to do the following: * Aims to be easily understood by youth and adults alike. * Doesn't expect you to have the slightest clue about programming. * Teaches the fun and easy to learn Liberty BASIC programming language. ==Free Version== Yes, you don't actually have to purchase Liberty BASIC to follow this tutorial. You will probably want to, though, once you see what all it can do. There is a free version of Liberty BASIC known as [[@http://justbasic.com|Just BASIC]]. It's missing a few features, but it's great fun nonetheless. All the code examples in this article will work in Just BASIC - I promise. ==Where to Find Help== Liberty BASIC and Just BASIC have great online communities with dedicated supporters who are very helpful. You can find them here: [[@http://www.libertybasic.conforums.com|Liberty BASIC Forums]] [[@http://www.justbasic.conforums.com|Just BASIC Forums]] Also, Liberty BASIC has an online version of the help file. This is //**the**// reference to have. [[@http://www.libertybasicuniversity.com/lb4help/|Liberty BASIC Online Help]] If you do nothing else, at least join one of the communities. They are great fun and you can find lots of neat programs, games, hints, and interesting conversations. ==Before We Start== Liberty BASIC will be referred to as LB in this article. If you're using Just BASIC (JB), the steps are the same as they are in LB. So just follow along and pretend to know what you're doing, and everything will be good. Experimenting is a great way to learn how to program. If you have an idea of your own, try it. Also, none of the provided code in this article will hurt your system. =MainWin= Interestingly enough, LB has a default terminal/console style window called the MainWin. As it's name implies, it is the "main window". It's quite versatile, and you can easily decide not to use it when you learn how to make your own windows later. However, this window is just what we want to start with. It's really easy to use. And if you ask me, it enjoys its job. Try copying and pasting the code below into the LB editor. (If you haven't copied and pasted something yet, you're going to love it. Just select the text with the mouse below [drag the blue stuff over it], and press Ctrl+C. That puts it on the clipboard. Then click inside the LB editor and press Ctrl+V. That pastes the text inside there.) [[code format="lb"]] Print "I'm a noob." End [[code]] Click the blue play button, or press Shift+F5 to run the program. A window should pop up saying "I'm a noob." If you have problems getting the code to run, make sure it's the only thing in the LB editor window. Not entirely unexpected. That window is the mainwin, and the PRINT command tells Liberty BASIC to put a new line of text in the mainwin. Simple enough? Let's try it again. [[code format="lb"]] Print "Hello, world!" Print "Whoa. This is on the next line!" [[code]] =Third Part Title= Text here. [[code format="lb"]] 'code here [[code]] ---- [[toc|flat]]