marko_tomas13 Posted September 21, 2004 Report Share Posted September 21, 2004 i have an assignment in which i have to transform DO...LOOP loops and FOR...NEXT loops to WHILE...WEND loops i transformed all but one and am having a little bit of troublethe second part of my question is that i will be starting a game soon that will need to be ready by june with steady work through the whole yeari was thinking about space invaders or something similar (going old school lol)if anyone has any tips or good resources for helping with coding games in quickbasic they would be greatly appreciatedthanks in advance ps dont really know if anyone on this board has had some experience with qb but y not give it a shot? Quote Link to post Share on other sites
CabDad Posted October 15, 2004 Report Share Posted October 15, 2004 Go to google and do a search for QBasics, how to use and so forth.Tried pasting the links to several Q info sites here, but having problems with my mouse.I also am learning the Q Program along with some other programming programs.Hope your having an easier time than me.Relacedf my mouse, here are some links. Hope they help.How Use QBasicGoogle search QBasicWhat is QBasic Google Quote Link to post Share on other sites
BitBangerUSA Posted October 21, 2004 Report Share Posted October 21, 2004 but what are the questions?problems with coding a while/wend loop - no details given. Quote Link to post Share on other sites
jcl Posted October 21, 2004 Report Share Posted October 21, 2004 (edited) i have an assignment in which i have to transform DO...LOOP loops and FOR...NEXT loops to WHILE...WEND loops i transformed all but one and am having a little bit of troubleQB has loops?ps dont really know if anyone on this board has had some experience with qb but y not give it a shot?Sure, why not. Haven't used it in ages, but it's fairly simple. Since you didn't say what your trouble was, brace yourself for a lot of very poor QB.DO ... LOOP comes in four forms. DO WHILE .. LOOP is, I believe, equivalent to WHILE ... WEND, so just change the words.DO UNTIL ... LOOP is the same but with the conditional inverted, so again just swap the words and change the test expression.DO ... LOOP WHILE ... and DO ... LOOP UNTIL ... may be a little trickier depending on whether the test is performed before or after the body of the loop is evaluated. If the test is performed after the body, the simplest solution may be to rewriteDO<body>LOOP WHILE <test>asDONE = 0WHILE NOT DONE<body>IF <test> THEN DONE = 0 ELSE DONE = 1WENDAssuming NOT DONE is a true when DONE = 0 and false when DONE = 1. If you can write IF NOT <test> THEN DONE = 1 you'll save some space and probably gain some speed.Again, for the UNTIL forms just rewrite the tests.You should be able to transform FOR ... NEXT loops into WHILE ... WEND by making the WHILE condition the last value in the FOR and moving the increment into the loop body. So instead ofFOR I = 1 TO 10blah blahNEXTyou haveI = 1WHILE I <= 10blah blahI = I + 1WENDAgain, I don't know QB, so some or all of this could be wrong. Probably all of it. Edited October 21, 2004 by jcl Quote Link to post Share on other sites
marko_tomas13 Posted October 21, 2004 Author Report Share Posted October 21, 2004 thanks for the help guys...i figured it out in class after some trial and error cause i had to make some new variables and redefine some otherslooking forward to making the game later in the year thats gonna be a good challenge Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.