lbjoseph
Jul 1, 2011
=Basics=<span style="font-size: 13px; font-weight: normal; line-height: 19px;">Basics ofProgramming=Programming</span>= //[[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 dotutorials should have thefollowing:following characteristics: *Aims toProgramming tutorials should be easily understood by youth and adults alike. *Doesn'tProgramming tutorials shouldn't expect you to have the slightest clue about programming. *Teaches theProgramming tutorials should teach a fun and easyto learn Liberty BASICprogramming language.==Free Version== Yes, you don't actually haveThe end of this article links topurchase Liberty BASIC to follow this tutorial. You will probably want to, though, once you see what all it can do.a series which does just that.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//**However**//, you should finish reading thisarticle will work in Just BASIC - I promise.introduction so you know how to go about learning and finding help. ==Where to Find Help== Liberty BASICand Just BASIC have greathas an //**awesome**// onlinecommunitiescommunity 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 joinone ofthecommunities. They are great funLiberty BASIC Forum andyou can find lots of neat programs, games, hints, and interesting conversations.check it every week or so. ==BeforeWeYou Start== Liberty BASICwill beis referred to as LB in thisarticle. If you're using Justarticle, as well as many others on the LBPE (Liberty BASIC(JB), the stepsProgrammer's Encyclopedia - where you arethe same as they are in LB. So just follow along and pretend to know what you're doing, and everything will be good.right now).Experimenting is a great wayIt's easier tolearn how to program.read and type that way. A lot can be learned by experimenting. If you have an ideaof your own,to try something, go ahead and try it. That's pretty much the only way to find certain things out, anyways. Programming requires //**you**// to take the initiative and be willing to learn. Part of that is experimenting.Also, none of the provided code in this article will hurt your system.Do you //**hate**// math? You're going to like programming.=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, andDo youcan easily decide not**//love//** math? You're still going touse it when you learn how to make your own windows later.like programming.However, this window is just what we wantProgramming allows you tostart with. It's really easyapply the science of math touse. And ifsolve problems in an organized fashion, but doesn't require you spend all your time working with odd symbols and weird patterns of thinking. Programming is pretty natural, once youask me, it enjoys its job.get the "hang" of it.Try copying and pastingHowever, if you're writing a program that requires a lot of mathematical computations, you would have to be able to figure out the equations you need before you program them. You can't program anything you don't understand. The only way around that is to use someone else's codebelow into the LB editor.who did understand what they were doing. In which case, you only need to understand how to use their code - which is often simpler.(If you haven't copied and pasted something yet, you're going=No Brains Required= You don't have tolove it. Just select the text with the mouse below [drag the blue stuff over it],be super smart to learn programming. You just need to be **//willing//** to learn. The online forums andpress Ctrl+C. That puts it on the clipboard. Then click inside the LB editortutorials available for Liberty BASIC are very supportive andpress 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+F5easy torun the program.follow. All you have to do is spend a little time reading and practicing.A window should pop up saying "I'm=Jumpstart= There is anoob."series of lessons (with pictures!) that teach programming from the ground-up on the LBPE. This series is called "Jumpstart."If you have problems gettingThis author highly recommends following thecode to run, make sure it'sshort lessons until you've taught yourself theonly thing inbasics. Also, there is a wealth of information available here on theLB editor window.LBPE as programming reference and how-to's.Not entirely unexpected. That window is the mainwin,Be sure to read everything. Skimming and speed reading does //**not**// work with programming. You have thePRINT command tells Liberty BASICability toput a new line of text in the mainwin. Simple enough? Let's try it again. [[code format="lb"]] Print "Hello, world!" Print "Whoa. Thisfocus and pay attention for as long as you like. Your attention span ison the next line!" [[code]]entirely up to you and how much you'd like to learn at a time. Don't overwork yourself, either. Be sure to get up off your computer every so often and take a break. That's usually when this author figures most of his problems out.=Third Part Title= Text here. [[code format="lb"]] 'code here [[code]][[jumpstart|Begin Jumpstart]] ---- [[toc|flat]]