Recommended Posts

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 trouble

the 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 year

i 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 appreciated

thanks in advance

ps dont really know if anyone on this board has had some experience with qb but y not give it a shot?

Link to post
Share on other sites
  • 4 weeks later...

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 QBasic

Google search QBasic

What is QBasic Google

Link to post
Share on other sites
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 trouble

QB 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 rewrite

DO
<body>
LOOP WHILE <test>

as

DONE = 0
WHILE NOT DONE
<body>
IF <test> THEN DONE = 0 ELSE DONE = 1
WEND

Assuming 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 of

FOR I = 1 TO 10
blah blah
NEXT

you have

I = 1
WHILE I <= 10
blah blah
I = I + 1
WEND

Again, I don't know QB, so some or all of this could be wrong. Probably all of it. :)

Edited by jcl
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...