Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199804.adf » PD » Markwart/DisSquare

Markwart/DisSquare

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199804.adf » PD
Filename: Markwart/DisSquare
Read OK:
File size: 030F bytes
Load address: 0000
Exec address: 0000
File contents
    1MODE 28
    2minx=0
    3miny=0
    4maxx=1024
    5maxy=1024
    6INPUT "Square disection ";x
    7CLS
    8FOR j=1 TO 2*x
    9  PROCsquare(minx, miny, maxx, maxy)
   10  difx=(maxx-minx)/x
   11  dify=(maxy-miny)/x
   12  FOR i=1 TO x-1
   13    x_ray=minx+difx
   14    y_ray=miny+difx
   15    next_y=miny+dify*i
   16    next_x=minx+difx*i
   17    LINE minx,next_y,minx+difx,next_y
   18    LINE maxx-difx,next_y,maxx,next_y
   19    LINE next_x,miny,next_x,miny+dify
   20    LINE next_x,maxy-dify,next_x,maxy
   21  NEXT
   22  minx=minx+difx
   23  maxx=maxx-difx
   24  miny=miny+dify
   25  maxy=maxy-dify
   26NEXT
   27PROCsquare(minx, miny, maxx, maxy)
   28g$=GET$
   29SYS "Wimp_CommandWindow",-1
   30END
   31
   32DEF PROCsquare(minx, miny, maxx, maxy)
   33  LINE minx,miny,minx,maxy
   34  LINE minx,maxy,maxx,maxy
   35  LINE maxx,maxy,maxx,miny
   36  LINE maxx,miny,minx,miny
   37ENDPROC
   38
� 28

minx=0

miny=0

maxx=1024

maxy=1024
� "Square disection ";x
�
� j=1 � 2*x
	%  �square(minx, miny, maxx, maxy)

  difx=(maxx-minx)/x
  dify=(maxy-miny)/x
  � i=1 � x-1

    x_ray=minx+difx
    y_ray=miny+difx
    next_y=miny+dify*i
    next_x=minx+difx*i
&    � minx,next_y,minx+difx,next_y
&    � maxx-difx,next_y,maxx,next_y
&    � next_x,miny,next_x,miny+dify
&    � next_x,maxy-dify,next_x,maxy
  �
  minx=minx+difx
  maxx=maxx-difx
  miny=miny+dify
  maxy=maxy-dify
�
#�square(minx, miny, maxx, maxy)
g$=�
ș "Wimp_CommandWindow",-1
�

 %� �square(minx, miny, maxx, maxy)
!  � minx,miny,minx,maxy
"  � minx,maxy,maxx,maxy
#  � maxx,maxy,maxx,miny
$  � maxx,miny,minx,miny
%�
&
�
00000000  0d 00 01 08 eb 20 32 38  0d 00 02 0a 6d 69 6e 78  |..... 28....minx|
00000010  3d 30 0d 00 03 0a 6d 69  6e 79 3d 30 0d 00 04 0d  |=0....miny=0....|
00000020  6d 61 78 78 3d 31 30 32  34 0d 00 05 0d 6d 61 78  |maxx=1024....max|
00000030  79 3d 31 30 32 34 0d 00  06 1b e8 20 22 53 71 75  |y=1024..... "Squ|
00000040  61 72 65 20 64 69 73 65  63 74 69 6f 6e 20 22 3b  |are disection ";|
00000050  78 0d 00 07 05 db 0d 00  08 0f e3 20 6a 3d 31 20  |x.......... j=1 |
00000060  b8 20 32 2a 78 0d 00 09  25 20 20 f2 73 71 75 61  |. 2*x...%  .squa|
00000070  72 65 28 6d 69 6e 78 2c  20 6d 69 6e 79 2c 20 6d  |re(minx, miny, m|
00000080  61 78 78 2c 20 6d 61 78  79 29 0d 00 0a 18 20 20  |axx, maxy)....  |
00000090  64 69 66 78 3d 28 6d 61  78 78 2d 6d 69 6e 78 29  |difx=(maxx-minx)|
000000a0  2f 78 0d 00 0b 18 20 20  64 69 66 79 3d 28 6d 61  |/x....  dify=(ma|
000000b0  78 79 2d 6d 69 6e 79 29  2f 78 0d 00 0c 11 20 20  |xy-miny)/x....  |
000000c0  e3 20 69 3d 31 20 b8 20  78 2d 31 0d 00 0d 17 20  |. i=1 . x-1.... |
000000d0  20 20 20 78 5f 72 61 79  3d 6d 69 6e 78 2b 64 69  |   x_ray=minx+di|
000000e0  66 78 0d 00 0e 17 20 20  20 20 79 5f 72 61 79 3d  |fx....    y_ray=|
000000f0  6d 69 6e 79 2b 64 69 66  78 0d 00 0f 1a 20 20 20  |miny+difx....   |
00000100  20 6e 65 78 74 5f 79 3d  6d 69 6e 79 2b 64 69 66  | next_y=miny+dif|
00000110  79 2a 69 0d 00 10 1a 20  20 20 20 6e 65 78 74 5f  |y*i....    next_|
00000120  78 3d 6d 69 6e 78 2b 64  69 66 78 2a 69 0d 00 11  |x=minx+difx*i...|
00000130  26 20 20 20 20 86 20 6d  69 6e 78 2c 6e 65 78 74  |&    . minx,next|
00000140  5f 79 2c 6d 69 6e 78 2b  64 69 66 78 2c 6e 65 78  |_y,minx+difx,nex|
00000150  74 5f 79 0d 00 12 26 20  20 20 20 86 20 6d 61 78  |t_y...&    . max|
00000160  78 2d 64 69 66 78 2c 6e  65 78 74 5f 79 2c 6d 61  |x-difx,next_y,ma|
00000170  78 78 2c 6e 65 78 74 5f  79 0d 00 13 26 20 20 20  |xx,next_y...&   |
00000180  20 86 20 6e 65 78 74 5f  78 2c 6d 69 6e 79 2c 6e  | . next_x,miny,n|
00000190  65 78 74 5f 78 2c 6d 69  6e 79 2b 64 69 66 79 0d  |ext_x,miny+dify.|
000001a0  00 14 26 20 20 20 20 86  20 6e 65 78 74 5f 78 2c  |..&    . next_x,|
000001b0  6d 61 78 79 2d 64 69 66  79 2c 6e 65 78 74 5f 78  |maxy-dify,next_x|
000001c0  2c 6d 61 78 79 0d 00 15  07 20 20 ed 0d 00 16 14  |,maxy....  .....|
000001d0  20 20 6d 69 6e 78 3d 6d  69 6e 78 2b 64 69 66 78  |  minx=minx+difx|
000001e0  0d 00 17 14 20 20 6d 61  78 78 3d 6d 61 78 78 2d  |....  maxx=maxx-|
000001f0  64 69 66 78 0d 00 18 14  20 20 6d 69 6e 79 3d 6d  |difx....  miny=m|
00000200  69 6e 79 2b 64 69 66 79  0d 00 19 14 20 20 6d 61  |iny+dify....  ma|
00000210  78 79 3d 6d 61 78 79 2d  64 69 66 79 0d 00 1a 05  |xy=maxy-dify....|
00000220  ed 0d 00 1b 23 f2 73 71  75 61 72 65 28 6d 69 6e  |....#.square(min|
00000230  78 2c 20 6d 69 6e 79 2c  20 6d 61 78 78 2c 20 6d  |x, miny, maxx, m|
00000240  61 78 79 29 0d 00 1c 08  67 24 3d be 0d 00 1d 1e  |axy)....g$=.....|
00000250  c8 99 20 22 57 69 6d 70  5f 43 6f 6d 6d 61 6e 64  |.. "Wimp_Command|
00000260  57 69 6e 64 6f 77 22 2c  2d 31 0d 00 1e 05 e0 0d  |Window",-1......|
00000270  00 1f 04 0d 00 20 25 dd  20 f2 73 71 75 61 72 65  |..... %. .square|
00000280  28 6d 69 6e 78 2c 20 6d  69 6e 79 2c 20 6d 61 78  |(minx, miny, max|
00000290  78 2c 20 6d 61 78 79 29  0d 00 21 1b 20 20 86 20  |x, maxy)..!.  . |
000002a0  6d 69 6e 78 2c 6d 69 6e  79 2c 6d 69 6e 78 2c 6d  |minx,miny,minx,m|
000002b0  61 78 79 0d 00 22 1b 20  20 86 20 6d 69 6e 78 2c  |axy..".  . minx,|
000002c0  6d 61 78 79 2c 6d 61 78  78 2c 6d 61 78 79 0d 00  |maxy,maxx,maxy..|
000002d0  23 1b 20 20 86 20 6d 61  78 78 2c 6d 61 78 79 2c  |#.  . maxx,maxy,|
000002e0  6d 61 78 78 2c 6d 69 6e  79 0d 00 24 1b 20 20 86  |maxx,miny..$.  .|
000002f0  20 6d 61 78 78 2c 6d 69  6e 79 2c 6d 69 6e 78 2c  | maxx,miny,minx,|
00000300  6d 69 6e 79 0d 00 25 05  e1 0d 00 26 04 0d ff     |miny..%....&...|
0000030f