Beginning Programming with Just BASIC -- Tutorial 4: Loops

preview_player
Показать описание
In which I demonstrate the usage of for-loops and while-loops, and program a method of determining the square root of a number.
Рекомендации по теме
Комментарии
Автор

sorry about the hassle i just realized i forgot to put end if at the end

Masterbabzmixes
Автор

hey this is cool...but can u tell me where actually do we use 'for and while 'loops in game programming...plz..it would help me a lot.

gamefreak
Автор

OK, thanks I'll try it, great tutorial by the way the ones I've seen didn't explain things as half as clearly as you did

Masterbabzmixes
Автор

how does the sum function work? I cannot get it to do anything but just spit out zero

aojohn
Автор

Probably a bit late but could I add, You would have to type "Bill Gates" exactly like that to be correct, is there a way to forget about caps? or have to individually put each line in?

MrExizable
Автор

@faithmantoya Thanks,

I'll try to keep them coming but I recently got a job this summer and I've been working like 50 hours a week! O.o When I have a few days off maybe I'll make some more.

Glad you appreciate them!

~DTH

CivilDefenseEngineer
Автор

i used both loops and looped them with branch labels.the lag is real.i had to reboot

hoodedcreeper
Автор

I ran this program but it gives me an error message no matter what number i put in
Runtime Error:Division by zero
What did I do wrong. I looked over my program and it's exactly like yours.

karangetigeroke
Автор

whenever i write this code it always highlights the if through then part what is wrong with my code:[start]
print "What is the name$ of the guy who created microsoft"
input name$
if name$ = Bill Gates then
print "CORRECT"
else
print "WRONG, press enter to try again"
input stuff
goto [start]

Masterbabzmixes
Автор

it would help if you had pointed out that an unassigned variable is automatically "zero" by default. And so this is why you have to assign it as you do, yes? im not all to sure im still fairly new to jb let alone all around computer programming.

tatartist
Автор

I don't understand what iterations are?

xQMgaming
Автор

it still doesn't work is it my compiler or...?

Masterbabzmixes
Автор

Yes. You can use either upper$ or lower$ It would look like either:
name$ = upper$(name$)
which would turn every letter into an uppercase letter or
name$ = lower$(name$)
which would turn everything into lowercase letters.

However, if you are planning on printing name$ back out onto the screen it would be in upper or lowercase letters. so here would be a way to do that without modifying name$

If upper$(name$) = "BILL GATES" Then Print "CORRECT!!" else Print "Nice try!"

Mike
Автор

"Kill BASIC programs" didn't kill an endless while loop - I had to resort to Task Manager.

RobertWF
Автор

i agree...i also couldnt do it at all.. :(

gamefreak
Автор

Put quotes around Bill Gates. It is a string.

if name$ = "Bill Gates" then print "CORRECT"

CivilDefenseEngineer
welcome to shbcf.ru