SET MODE "color" SET WINDOW 0,1026,0,750 SET BACKGROUND COLOR "white" LET x=rnd LET y=rnd LET a=0 LET s1=1200 LET s2 =s1*750/1026 RANDOMIZE PRINT" corner DRAGON I.F.S." PRINT" BY R.L.BAGULA 6 Oct 1998 ©" FOR n= 1 TO 2560000 LET a =RND LET b=RND IF a <= 1/3 THEN LET x1=x/2 LET y1=y/2 END IF IF a<= 2/3 AND a>1/3 THEN LET x1= y/2 LET y1=-x/2 -1/2 END IF IF a<= 1 AND a>2/3 THEN LET x1= -y/2-1/2 LET y1=x/2 END IF SET COLOR 255 LET x=x1 LET y=y1 IF n>10 THEN PLOT 1026/2+s1*x+200,750/2+s2*y+200 NEXT n END SET MODE "color" SET WINDOW 0,1026,0,750 SET COLOR MIX(0) 1,1,1 SET COLOR MIX(1) 0,0,0 DECLARE DEF xorb PRINT" Hadamard/Sylvester matrix as 0's and ones as Gray code" PRINT " input binary power n:2^n maximum 1024= 2^10" INPUT n DIM b(0 to 1026,0 to 12) FOR i= 0 to 2^n FOR k=0 to n LET b(i,k)=int(mod(i/2^k,2)) NEXT k NEXT i REM BINARY TO GRAY CODE AS ONE HIGHER BIT VECTOR XOR FOR i= 0 to 2^n FOR k=0 to n LET ab=b(i,k) LET bb=b(i,k+1) IF ab =0 and bb=0 then LET CC=0 IF ab =0 and bb=1 then LET CC=1 IF ab =1 and bb=0 then LET CC=1 IF ab =1 and bb=1 then LET CC=0 LET b(i,k)=cc NEXT k NEXT i FOR i= 0 to 2^n IF i>1026 then EXIT FOR FOR j=0 to 2^n IF j> 750 then EXIT FOR LET sum =0 FOR k=0 to n LET sum=sum +b(i,k)*b(j,k) NEXT k IF sum =0 then SET COLOR 1 else SET COLOR 0 PLOT i,j NEXT j NEXT i SET COLOR 255 PRINT" Hadamard/ Sylvester Matrix as 0's and 1's as Gray code" PRINT" By R. L. Bagula 6 Oct 1998(C)" END