In The code, you'll see me writing [] and (). These correspond to the filled square character and the empty square character.
{7,21}->Dim Mat C
Fill(0, Mat C)
1->X
RanInt#(3,6)->Y
0->A
0->B
0->K
While X<22
Y+RanInt#(-1,1)->Y
If Y>7
Then 7->Y
IfEnd
If Y<2
Then 2->Y
IfEnd
Locate X,Y,"()"
1->Mat C[Y,X]
For Y+1->I to 7 Step 1
Locate X,I,"[]"
2->Mat C[Y,X]
Next
X+1->X
WhileEnd
Locate 1,2,"I"
9->Mat C[2,1]
1->X
2->Y
While K!=47
Locate 1,1,"()"
Locate 2,1,A
Locate 6,1,B
Locate 5,1,"[]"
If Mat C[Y+1,X]=0
Then Locate X,Y," "
0->Mat C[Y,X]
Y+1->Y
9->Mat C[Y,X]
Locate X,Y,"I"
IfEnd
Getkey->K
If K=38 And X>1 And Mat C[Y,X+1]=0
Then 0->Mat C[Y,X+1]
Locate X,Y," "
X+1->X
9->Mat C[Y,X]
Locate X,Y,"I"
IfEnd
If K=27 And X<27 And Mat C[Y,X-1]=0
Then 0->Mat C[Y,X-1]
Locate X,Y," "
X-1->X
9->Mat C[Y,X]
Locate X,Y,"I"
IfEnd
WhileEnd
I hand-typed this code while looking at my calc screen so if you see any weird typing mistakes just ignore them

This is a world generation program that I will be using for my secret project (even though it's not so secret, because you now see my source code
 )
)I'm getting ARGUMENT ERROR at the line that says:
If K=27 And X<27 And Mat C[Y,X-1]=0
What is going on here? Everything should be OK...
Also, everything else works fine, the world generator and the player falling mechanism.


 
	 
			
			
			
				 
					 
			
			 
				
				
			
 
  
	 
	 
	 
	 
	
