Print"Welcome to GridFit!" print"By: Shraddha Pradeep" print print"What does this program do?" print" -This program was made to fit a series" print"of patterns into nonshadded slots on a grid" print"How do I use this program?" print" -Enter the total number of shadded spaces followed" print"by the exact spaces that are to be shaded" print" -Enter in five patterns(1,2,or 3) to fit into your " print"customized grid" print" -The program will print the first avalible slot for the pattern" print print input"Please enter numbers that are to be shadded: ";shadded$ input"Number of first pattern: ";pat(1) input"Number of second pattern: ";pat(2) input"Number of third pattern: ";pat(3) input"Number of fourth pattern: ";pat(4) input"Number fo fifth pattern: ";pat(5) for s=1 to 5 if pat(s)=1 then goto [pattern1] if pat(s)=2 then goto [pattern2] if pat(s)=3 then goto [pattern3] [full] num=0 dim full(5,5) for x=1 to 5 for y= 1 to 5 num= num+1 next next [pattern1] var1=1 len$=word$(shadded$,var1,",") for y=1 to 25 found=0 x=1 var2=2 dim nonshadded(30) for x=1 to val(len$) len1$=word$(shadded$,var2,",") dim grayed(30) grayed(x) = val(len1$) if grayed(x) = y then found = 1 if pat1=y then found=1 if pat2=y then found=1 if pat3=y then found=1 if pat21=y then found=1 if pat31=y then found=1 var2=var2+1 next x if found =0 then nonshadded(y) = y if nonshadded(y) <> 0 then exit for next y pat1= nonshadded(y) print nonshadded(y) goto [nexts] [pattern2] var1=1 len$=word$(shadded$,var1,",") for y=1 to 25 found=0 x=1 var2=2 dim nonshadded(30) for x=1 to val(len$) len1$=word$(shadded$,var2,",") dim grayed(30) grayed(x) = val(len1$) if grayed(x) = y then found=1 if pat1=y then found=1 if pat2=y then found=1 if pat3=y then found=1 if pat21=y then found=1 if pat31=y then found=1 var2=var2+1 next x if found =0 then nonshadded(y) = y if y= 1 then x1=nonshadded(1) if y= 2 then x2=nonshadded(2) if y= 3 then x3=nonshadded(3) if y= 4 then x4=nonshadded(4) if y= 5 then x5=nonshadded(5) if y= 6 then x6=nonshadded(6) if y= 7 then x7=nonshadded(7) if y= 8 then x8=nonshadded(8) if y= 9 then x9=nonshadded(9) if y= 10 then x10=nonshadded(10) if y= 11 then x11=nonshadded(11) if y= 12 then x12=nonshadded(12) if y= 13 then x13=nonshadded(13) if y= 14 then x14=nonshadded(14) if y= 15 then x15=nonshadded(15) if y= 16 then x16=nonshadded(16) if y= 17 then x17=nonshadded(17) if y= 18 then x18=nonshadded(18) if y= 19 then x19=nonshadded(19) if y= 20 then x20=nonshadded(20) if y= 21 then x21=nonshadded(21) if y= 22 then x22=nonshadded(22) if y= 23 then x23=nonshadded(23) if y= 24 then x24=nonshadded(24) if y= 25 then x25=nonshadded(25) next y if x25=x20+5 then r=x20 if x24=x19+5 then r=x19 if x23=x18+5 then r=x18 if x22=x17+5 then r=x17 if x21=x16+5 then r=x16 if x20=x15+5 then r=x15 if x19=x14+5 then r=x14 if x18=x13+5 then r=x13 if x17=x12+5 then r=x12 if x16=x11+5 then r=x11 if x15=x10+5 then r=x10 if x14=x9+5 then r=x9 if x13=x8+5 then r=x8 if x12=x7+5 then r=x7 if x11=x6+5 then r=x6 if x10=x5+5 then r=x5 if x9=x4+5 then r=x4 if x8=x3+5 then r=x3 if x7=x2+5 then r=x2 if x6=x1+5 then r=x1 pat2=r pat21=r+5 print r goto[nexts] [pattern3] 'print pat2 var1=1 len$=word$(shadded$,var1,",") for y=1 to 25 found=0 x=1 var2=2 dim nonshadded(30) for x=1 to val(len$) len1$=word$(shadded$,var2,",") dim grayed(30) grayed(x) = val(len1$) if grayed(x) = y then found=1 if pat1=y then found=1 if pat2=y then found=1 if pat3=y then found=1 if pat21=y then found=1 if pat31=y then found=1 var2=var2+1 next x if found =0 then nonshadded(y) = y if y= 1 then x1=nonshadded(1) if y= 2 then x2=nonshadded(2) if y= 3 then x3=nonshadded(3) if y= 4 then x4=nonshadded(4) if y= 5 then x5=nonshadded(5) if y= 6 then x6=nonshadded(6) if y= 7 then x7=nonshadded(7) if y= 8 then x8=nonshadded(8) if y= 9 then x9=nonshadded(9) if y= 10 then x10=nonshadded(10) if y= 11 then x11=nonshadded(11) if y= 12 then x12=nonshadded(12) if y= 13 then x13=nonshadded(13) if y= 14 then x14=nonshadded(14) if y= 15 then x15=nonshadded(15) if y= 16 then x16=nonshadded(16) if y= 17 then x17=nonshadded(17) if y= 18 then x18=nonshadded(18) if y= 19 then x19=nonshadded(19) if y= 20 then x20=nonshadded(20) if y= 21 then x21=nonshadded(21) if y= 22 then x22=nonshadded(22) if y= 23 then x23=nonshadded(23) if y= 24 then x24=nonshadded(24) if y= 25 then x25=nonshadded(25) next y if x25=x24+1 then p=x24 if x24=x23+1 then p=x23 if x23=x22+1 then p=x22 if x22=x21+1 then p=x21 if x20=x19+1 then p=x19 if x19=x18+1 then p=x18 if x18=x17+1 then p=x17 if x17=x16+1 then p=x16 if x15=x14+1 then p=x14 if x14=x13+1 then p=x13 if x13=x12+1 then p=x12 if x12=x11+1 then p=x11 if x10=x9+1 then p=x9 if x9=x8+1 then p=x8 if x8=x7+1 then p=x7 if x7=x6+1 then p=x6 if x5=x4+1 then p=x4 if x4=x3+1 then p=x3 if x3=x2+1 then p=x2 if x2=x1+1 then p=x1 pat3=p pat31=p+1 print p goto [nexts] [nexts] next s