Cool Program tweak
BlitzPlus Forums/BlitzPlus Tutorials/Cool Program tweak
| ||
Hello, in this article I am going to show you a trick in BlitzBasic coding. First off, BlitzBasic is a language used for making games. Second of all, please do not try to make a program using BlitzPlus it is not made for anything other than making games. _______________________________________________ Now for the fun stuff ;) Parts of this article: Part 1: Intro Part 2: The program Part 3: How the program works Part End: Last of article ------------------------Part 1------------------------- Introduction to BlitzPlus/Basic Hello, BlitzBasic is a very, very easy to understand language. I am almost positive you will follow along but if you don't please go to Part 3 for a step by step guide to this tutorial. Okay now it is very easy to learn BlitzBasic, all you have to do to print 'Hello World' is this Print "Hello World" delay 5000 Now wasn't that easy if not just hang on I will tell you about it in Part 3. --------------------------Part 2------------------------ The Program. ;pass.exe - password protect AppTitle "passbox" ;asks user the pass hehe = Input$("What is the password? ") ;var lol = 11514251514 ha$ = "'http://somesite.org'" ;looks to see if pass was right .password If hehe = lol Then Print "correct!" Delay 500 Print "your link is " + ha + "!" Delay 50000 End ;tells user to guess again Else Print "You have 3 trys left!" Print "" hehe = Input$("What is the password? ") Goto password1 EndIf ;looks to see if pass was right .password1 If hehe = lol Then Print "correct!" Delay 500 Print "your link is " + ha + "!" Delay 50000 End ;askes user to guess again Else Print "You have 2 trys left!" Print "" hehe = Input$("What is the password? ") Goto password2 EndIf ;looks to see if pass was right .password2 If hehe = lol Then Print "correct!" Delay 500 Print "your link is " + ha + "!" Delay 50000 End ;askes user to guess again Else Print "You have 1 try left!" Print "" hehe = Input$("What is the password? ") Goto passwordend EndIf ;looks to see if pass was right .passwordend If hehe = lol Then Print "correct!" Delay 500 Print "your link is " + ha + "!" Delay 50000 End ;tells user he can't guess any more Else Print "You have 0 trys left!" Delay 250 Print "This will end in 2.5 seconds" EndIf ;waits 2.5 seconds, then ends Delay 2500 End -----------------------Part 3-------------------------- How passbox.exe works ' ; ' means this comment ' print ' means print text ' input$ ' means type something (in numbers) ' lol ' this is a variable ' ha$ ' this is a variable ' delay ' means how many milliseconds go by before it goes to the next command. ' goto ' Never use this! ' hehe ' this names the the line as in hehe = Input$("What is the password? ") ' .sometext ' this names the block ' apptitle ' names the application ' end ' ends program instantly ' if ' this is what happens if condition is true ' else ' this is what happens when condition is false ' endif ' ends the if...else loop -----------------------Part End------------------------ Last of this article I hope you liked it. |
| ||
Your beggining statement is very blunt, and narrow-minded BlitzPlus' GUI capabilities can be used for bolth game's and program's. Nice explaining though, I can't say I agree with the beggining. |
| ||
What the print "hello world" thing or hehe=input$? P.S. This post wasn't really made for this site but I decided to put it here any ways. |
| ||
[code][/code] or [/codebox] |
| ||
"Second of all, please do not try to make a program using BlitzPlus it is not made for anything other than making games. " Huh? You can do plenty with BlitzPlus. Even more when you include DLL's. I am currently writing an app for a robotics project in Blitz and its coming along great :) I have already been able to send and receive messages to/from the PC and bot via rs-232. I have accessed the bots ultrasonic range finders, GPS unit and tri axel accellerometer. I am also using the Blitz Virtual Machine to the allow the user to run scripts within my Blitz application that control the robot. Blitz has the primary responsibility of providing a GUI, running the script, coordinating communications and storing and displaying the maps and GPS Coords. Sure, having a degree in Software Applications Programming helps, but you can definately make more than games with Blitz! |
| ||
I'm actually going to make a Blitz-based robot too, by mounting a computer on some wheels hooked up to an SSC-32. |
| ||
Ok this tutorial doesn't make a whole lot of sense... there are numerous things wrong with it. First, variable names should be something relevant to what they represent unless they are a temporary variable. And, in the case of temporary variables, it is standard convention to use single characters such as x,y,i, and j. Second, GOTO should be used extremely sparingly, as it usually creates unorganized code and makes it difficult for someone to follow. The author states this, yet uses GOTO in their program. This example does a similar thing, but uses proper commenting and coding technique: (Tabbing should appear correctly in the Blitz IDE. You may need to know a bit about Blitz programming to fully understand this example.) |
| ||
I agree. Blitz Plus is quite useful, especially for writing Windows Apps to do fidly little tasks. The original post is badly written apart from - My favourite bit is : If hehe = lol Then We could improve this to : If hehe = lol Then rofl |
| ||
What a waste of space. Actually I have written a number of utilities with blitz3D (using the 2D commandset = BlitzPlus) |
| ||
I've found a use for blitzplus in my work - needed to strip out extraneous Line Feeds (Ascii character 10) from data exported from MS Excel in CSV format and with a 25 line app in blitzplus have manged to do it so that it can then be imported readily into our database. |
| ||
Yeah, blitz+ is brillaint for those little apps that dont exist for doing simple things. |