For loops?

Blitz3D Forums/Blitz3D Beginners Area/For loops?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Every math class I have, we always do a 10 minute division drill. Since I am rather slow at it, I thought I would make a program to help me out, but I am having troubles with for loops. On the drill, there is a grid of 90 squares, and on the left most colum, the teacher puts random numbers from 100 to 999. On the top colum he puts random numbers between 1 and 9. You divide the first small number by the first big number, and then you divide the first small number by the 2nd big number etc... The teacher told us that it would be easier to put a "." instead of a little "r" to signify a remainder.
Here is the code I have so far:
AppTitle "Math Drill"

;num_1=10/3
;r=10 Mod 3
;Print num_1+"."+r
;WaitKey()

Graphics 800,600

font1=LoadFont("Arial",26,True,False)

SetBuffer BackBuffer()

SeedRnd MilliSecs()

.start

Time% = MilliSecs() + 600000

num_x=218
num_y2=218
;big_numbers=Rnd(100,999)

While Not KeyHit(1)

Color 220,220,0
Rect 209,13,390,298,1

Color 0,0,0
Rect 214,18,380,288
For x=216 To 590	Step 42
	
	For y=20 To 280	Step 26
	
		Color 220,220,0
		Rect x,y,40,24,1
	
	Next
Next

Color 0,0,0
Oval 233,23,5,5,1
Rect 221,30,31,2,1
Oval 233,34,5,5,1

For big_numbers_for=1 To 10

	big_numbers=Rnd(100,999)
	
Next 

For num_y=46 To 300 Step 26
	
	Color 0,0,0
	Text num_x,num_y,big_numbers
		
Next

;For small_numbers=1 To 10

;small_numbers=Rnd(1,9)
	
;Next 

;For num_x2=218 To 300 Step 40
;	
;	Color 255,0,0
;	Text num_x2,num_y2,small_numbers
;		
;Next	
 


SetFont font1
Color 255,0,0
Text 347,565,"Time: "+((Time-MilliSecs())/1000)
If MilliSecs() > Time Then Goto time_up


Flip
Cls

Wend 

.time_up
End

If I put the small numbers in, the screen goes black and I can't exit. Why is that? The big_numbers keeps on repeating in the while loop why is that?