Home » Archimedes archive » Archimedes World » AW-1994-01.adf » AWJan94 » !AWJan94/Goodies/Disc/Example_2/Square

!AWJan94/Goodies/Disc/Example_2/Square

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 » Archimedes archive » Archimedes World » AW-1994-01.adf » AWJan94
Filename: !AWJan94/Goodies/Disc/Example_2/Square
Read OK:
File size: 046B bytes
Load address: 0000
Exec address: 0000
File contents
    1PROCList
    2LIBRARY "PathLib:OS_units.Paths"
    3PROCCreate_Objects
    4PROCDraw_Objects
    5END
    6
    7DEF PROCCreate_Objects 
    8 PROCPath_ObjectBegin(square%,15)
    9   x%=640 : y%=512 : hx%=200 : hy%=200
   10   PROCPath_Move(x%+hx%,y%+hy%)
   11   PROCPath_Draw(x%-hx%,y%+hy%)
   12   PROCPath_Draw(x%-hx%,y%-hy%)
   13   PROCPath_Draw(x%+hx%,y%-hy%)
   14   PROCPath_CloseWithLine
   15 PROCPath_ObjectEnd
   16ENDPROC
   17
   18DEF PROCDraw_Objects  
   19 SYS "Draw_Stroke",square% 
   20ENDPROC
   21
   22DEF PROCList
   23MODE MODE
   24COLOUR 2
   25PRINT "EXAMPLE 2: CONSTRUCTING A SQUARE, Centre 640,512 length of side 400" : PRINT
   26DATA "LIBRARY ""PathLib:OS_units.Paths"" "
   27DATA "PROCCreate_Objects"
   28DATA "PROCDraw_Objects"
   29DATA "END"
   30DATA ""
   31DATA "DEF PROCCreate_Objects"
   32DATA " PROCPath_ObjectBegin(square%,15)"
   33DATA "  x%=640 : y%=512 : hx%=200 : hy%=200"
   34DATA "  PROCPath_Move(x%+hx%,y%+hy%)"
   35DATA "  PROCPath_Draw(x%-hx%,y%+hy%)"
   36DATA "  PROCPath_Draw(x%-hx%,y%-hy%)"
   37DATA "  PROCPath_Draw(x%+hx%,y%-hy%)"
   38DATA "  PROCPath_CloseWithLine"
   39DATA " PROCPath_ObjectEnd"
   40DATA "ENDPROC"
   41DATA ""
   42DATA "DEF PROCDraw_Objects"  
   43DATA " SYS ""Draw_Stroke"",square%" 
   44DATA "ENDPROC"
   45COLOUR 1
   46FOR i%=1 TO 19 : READ x$ : PRINT x$ :NEXT
   47COLOUR 7
   48ENDPROC
   49
	�List
ț "PathLib:OS_units.Paths"
�Create_Objects
�Draw_Objects
�

� �Create_Objects 
" �Path_ObjectBegin(square%,15)
	*   x%=640 : y%=512 : hx%=200 : hy%=200

    �Path_Move(x%+hx%,y%+hy%)
    �Path_Draw(x%-hx%,y%+hy%)
    �Path_Draw(x%-hx%,y%-hy%)

    �Path_Draw(x%+hx%,y%-hy%)
   �Path_CloseWithLine
 �Path_ObjectEnd
�

� �Draw_Objects  
 ș "Draw_Stroke",square% 
�

� �List
� �
� 2
O� "EXAMPLE 2: CONSTRUCTING A SQUARE, Centre 640,512 length of side 400" : �
+� "LIBRARY ""PathLib:OS_units.Paths"" "
� "PROCCreate_Objects"
� "PROCDraw_Objects"
� "END"
� ""
� "DEF PROCCreate_Objects"
 )� " PROCPath_ObjectBegin(square%,15)"
!-� "  x%=640 : y%=512 : hx%=200 : hy%=200"
"&� "  PROCPath_Move(x%+hx%,y%+hy%)"
#&� "  PROCPath_Draw(x%-hx%,y%+hy%)"
$&� "  PROCPath_Draw(x%-hx%,y%-hy%)"
%&� "  PROCPath_Draw(x%+hx%,y%-hy%)"
& � "  PROCPath_CloseWithLine"
'� " PROCPath_ObjectEnd"
(� "ENDPROC"
)� ""
*� "DEF PROCDraw_Objects"  
+%� " SYS ""Draw_Stroke"",square%" 
,� "ENDPROC"
-� 1
. � i%=1 � 19 : � x$ : � x$ :�
/� 7
0�
1
�
00000000  0d 00 01 09 f2 4c 69 73  74 0d 00 02 1f c8 9b 20  |.....List...... |
00000010  22 50 61 74 68 4c 69 62  3a 4f 53 5f 75 6e 69 74  |"PathLib:OS_unit|
00000020  73 2e 50 61 74 68 73 22  0d 00 03 13 f2 43 72 65  |s.Paths".....Cre|
00000030  61 74 65 5f 4f 62 6a 65  63 74 73 0d 00 04 11 f2  |ate_Objects.....|
00000040  44 72 61 77 5f 4f 62 6a  65 63 74 73 0d 00 05 05  |Draw_Objects....|
00000050  e0 0d 00 06 04 0d 00 07  16 dd 20 f2 43 72 65 61  |.......... .Crea|
00000060  74 65 5f 4f 62 6a 65 63  74 73 20 0d 00 08 22 20  |te_Objects ..." |
00000070  f2 50 61 74 68 5f 4f 62  6a 65 63 74 42 65 67 69  |.Path_ObjectBegi|
00000080  6e 28 73 71 75 61 72 65  25 2c 31 35 29 0d 00 09  |n(square%,15)...|
00000090  2a 20 20 20 78 25 3d 36  34 30 20 3a 20 79 25 3d  |*   x%=640 : y%=|
000000a0  35 31 32 20 3a 20 68 78  25 3d 32 30 30 20 3a 20  |512 : hx%=200 : |
000000b0  68 79 25 3d 32 30 30 0d  00 0a 20 20 20 20 f2 50  |hy%=200...    .P|
000000c0  61 74 68 5f 4d 6f 76 65  28 78 25 2b 68 78 25 2c  |ath_Move(x%+hx%,|
000000d0  79 25 2b 68 79 25 29 0d  00 0b 20 20 20 20 f2 50  |y%+hy%)...    .P|
000000e0  61 74 68 5f 44 72 61 77  28 78 25 2d 68 78 25 2c  |ath_Draw(x%-hx%,|
000000f0  79 25 2b 68 79 25 29 0d  00 0c 20 20 20 20 f2 50  |y%+hy%)...    .P|
00000100  61 74 68 5f 44 72 61 77  28 78 25 2d 68 78 25 2c  |ath_Draw(x%-hx%,|
00000110  79 25 2d 68 79 25 29 0d  00 0d 20 20 20 20 f2 50  |y%-hy%)...    .P|
00000120  61 74 68 5f 44 72 61 77  28 78 25 2b 68 78 25 2c  |ath_Draw(x%+hx%,|
00000130  79 25 2d 68 79 25 29 0d  00 0e 1a 20 20 20 f2 50  |y%-hy%)....   .P|
00000140  61 74 68 5f 43 6c 6f 73  65 57 69 74 68 4c 69 6e  |ath_CloseWithLin|
00000150  65 0d 00 0f 14 20 f2 50  61 74 68 5f 4f 62 6a 65  |e.... .Path_Obje|
00000160  63 74 45 6e 64 0d 00 10  05 e1 0d 00 11 04 0d 00  |ctEnd...........|
00000170  12 15 dd 20 f2 44 72 61  77 5f 4f 62 6a 65 63 74  |... .Draw_Object|
00000180  73 20 20 0d 00 13 1e 20  c8 99 20 22 44 72 61 77  |s  .... .. "Draw|
00000190  5f 53 74 72 6f 6b 65 22  2c 73 71 75 61 72 65 25  |_Stroke",square%|
000001a0  20 0d 00 14 05 e1 0d 00  15 04 0d 00 16 0b dd 20  | .............. |
000001b0  f2 4c 69 73 74 0d 00 17  07 eb 20 eb 0d 00 18 07  |.List..... .....|
000001c0  fb 20 32 0d 00 19 4f f1  20 22 45 58 41 4d 50 4c  |. 2...O. "EXAMPL|
000001d0  45 20 32 3a 20 43 4f 4e  53 54 52 55 43 54 49 4e  |E 2: CONSTRUCTIN|
000001e0  47 20 41 20 53 51 55 41  52 45 2c 20 43 65 6e 74  |G A SQUARE, Cent|
000001f0  72 65 20 36 34 30 2c 35  31 32 20 6c 65 6e 67 74  |re 640,512 lengt|
00000200  68 20 6f 66 20 73 69 64  65 20 34 30 30 22 20 3a  |h of side 400" :|
00000210  20 f1 0d 00 1a 2b dc 20  22 4c 49 42 52 41 52 59  | ....+. "LIBRARY|
00000220  20 22 22 50 61 74 68 4c  69 62 3a 4f 53 5f 75 6e  | ""PathLib:OS_un|
00000230  69 74 73 2e 50 61 74 68  73 22 22 20 22 0d 00 1b  |its.Paths"" "...|
00000240  1a dc 20 22 50 52 4f 43  43 72 65 61 74 65 5f 4f  |.. "PROCCreate_O|
00000250  62 6a 65 63 74 73 22 0d  00 1c 18 dc 20 22 50 52  |bjects"..... "PR|
00000260  4f 43 44 72 61 77 5f 4f  62 6a 65 63 74 73 22 0d  |OCDraw_Objects".|
00000270  00 1d 0b dc 20 22 45 4e  44 22 0d 00 1e 08 dc 20  |.... "END"..... |
00000280  22 22 0d 00 1f 1e dc 20  22 44 45 46 20 50 52 4f  |""..... "DEF PRO|
00000290  43 43 72 65 61 74 65 5f  4f 62 6a 65 63 74 73 22  |CCreate_Objects"|
000002a0  0d 00 20 29 dc 20 22 20  50 52 4f 43 50 61 74 68  |.. ). " PROCPath|
000002b0  5f 4f 62 6a 65 63 74 42  65 67 69 6e 28 73 71 75  |_ObjectBegin(squ|
000002c0  61 72 65 25 2c 31 35 29  22 0d 00 21 2d dc 20 22  |are%,15)"..!-. "|
000002d0  20 20 78 25 3d 36 34 30  20 3a 20 79 25 3d 35 31  |  x%=640 : y%=51|
000002e0  32 20 3a 20 68 78 25 3d  32 30 30 20 3a 20 68 79  |2 : hx%=200 : hy|
000002f0  25 3d 32 30 30 22 0d 00  22 26 dc 20 22 20 20 50  |%=200".."&. "  P|
00000300  52 4f 43 50 61 74 68 5f  4d 6f 76 65 28 78 25 2b  |ROCPath_Move(x%+|
00000310  68 78 25 2c 79 25 2b 68  79 25 29 22 0d 00 23 26  |hx%,y%+hy%)"..#&|
00000320  dc 20 22 20 20 50 52 4f  43 50 61 74 68 5f 44 72  |. "  PROCPath_Dr|
00000330  61 77 28 78 25 2d 68 78  25 2c 79 25 2b 68 79 25  |aw(x%-hx%,y%+hy%|
00000340  29 22 0d 00 24 26 dc 20  22 20 20 50 52 4f 43 50  |)"..$&. "  PROCP|
00000350  61 74 68 5f 44 72 61 77  28 78 25 2d 68 78 25 2c  |ath_Draw(x%-hx%,|
00000360  79 25 2d 68 79 25 29 22  0d 00 25 26 dc 20 22 20  |y%-hy%)"..%&. " |
00000370  20 50 52 4f 43 50 61 74  68 5f 44 72 61 77 28 78  | PROCPath_Draw(x|
00000380  25 2b 68 78 25 2c 79 25  2d 68 79 25 29 22 0d 00  |%+hx%,y%-hy%)"..|
00000390  26 20 dc 20 22 20 20 50  52 4f 43 50 61 74 68 5f  |& . "  PROCPath_|
000003a0  43 6c 6f 73 65 57 69 74  68 4c 69 6e 65 22 0d 00  |CloseWithLine"..|
000003b0  27 1b dc 20 22 20 50 52  4f 43 50 61 74 68 5f 4f  |'.. " PROCPath_O|
000003c0  62 6a 65 63 74 45 6e 64  22 0d 00 28 0f dc 20 22  |bjectEnd"..(.. "|
000003d0  45 4e 44 50 52 4f 43 22  0d 00 29 08 dc 20 22 22  |ENDPROC"..).. ""|
000003e0  0d 00 2a 1e dc 20 22 44  45 46 20 50 52 4f 43 44  |..*.. "DEF PROCD|
000003f0  72 61 77 5f 4f 62 6a 65  63 74 73 22 20 20 0d 00  |raw_Objects"  ..|
00000400  2b 25 dc 20 22 20 53 59  53 20 22 22 44 72 61 77  |+%. " SYS ""Draw|
00000410  5f 53 74 72 6f 6b 65 22  22 2c 73 71 75 61 72 65  |_Stroke"",square|
00000420  25 22 20 0d 00 2c 0f dc  20 22 45 4e 44 50 52 4f  |%" ..,.. "ENDPRO|
00000430  43 22 0d 00 2d 07 fb 20  31 0d 00 2e 20 e3 20 69  |C"..-.. 1... . i|
00000440  25 3d 31 20 b8 20 31 39  20 3a 20 f3 20 78 24 20  |%=1 . 19 : . x$ |
00000450  3a 20 f1 20 78 24 20 3a  ed 0d 00 2f 07 fb 20 37  |: . x$ :.../.. 7|
00000460  0d 00 30 05 e1 0d 00 31  04 0d ff                 |..0....1...|
0000046b