Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_30.ADF » P/leap

P/leap

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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_30.ADF
Filename: P/leap
Read OK:
File size: 035D bytes
Load address: FFFF1D00
Exec address: FFFF8023
File contents
   10REM Leap Year checker from Roy Warner
   20REM Checks for a leap years.
   30 PROCconstants
   40MODE6
   50REPEAT
   60PROCyear
   70PROCsort
   80PROCresult
   90PROCexit
  100UNTIL a%=0:CLS
  110END
  120:
  130DEF PROCconstants
  140 nlp$="Is not a leap year"
  150 ilp$="Is a leap year"
  160 hdra$="Detects leap years. In accordance with"
  170 hdrb$="current knowledge!"
  180 yr$="give me a year?"
  190 ent$="Enter year"
  200 res$="The year "
  210 end$="Finished? Then type a Y."
  220ENDPROC
  230:
  240DEF PROCyear:CLS
  250 PRINTTAB(13,6)yr$
  260 PRINTTAB(12,9)ent$
  270 PRINTTAB(0,12)hdra$,hdrb$
  280 INPUTTAB(23,9)a%
  290 IF a%<=0 THEN GOTO250 ELSE ENDPROC
  300ENDPROC
  310:
  320DEF PROCsort
  330 IF a% MOD 100<>0 THEN PROCnotcent ELSE PROCcent
  340ENDPROC
  350:
  360DEF PROCnotcent
  370 IF a% MOD 4<>0 THEN flag=FALSE ELSE flag=TRUE
  380ENDPROC
  390:
  400DEF PROCcent
  410 IF a% MOD 400<>0 THEN flag=FALSE ELSE flag=TRUE
  420ENDPROC
  430:
  440DEF PROCresult:CLS
  450 PRINTTAB(13,6)res$;a%
  460 IF flag THEN PRINTTAB(13,8)ilp$ ELSE PRINTTAB(10,8)nlp$
  470ENDPROC
  480:
  490DEF PROCexit
  500 PRINTTAB(8,18)end$
  510 a$=INKEY$400
  520 IF a$="Y" THEN a%=0
  530ENDPROC

'� Leap Year checker from Roy Warner
� Checks for a leap years.
 �constants
(�6
2�
<	�year
F	�sort
P�result
Z	�exit
d� a%=0:�
n�
x:
�� �constants
� nlp$="Is not a leap year"
� ilp$="Is a leap year"
�3 hdra$="Detects leap years. In accordance with"
� hdrb$="current knowledge!"
� yr$="give me a year?"
� ent$="Enter year"
� res$="The year "
�$ end$="Finished? Then type a Y."
��
�:
�
� �year:�
� �13,6)yr$
 �12,9)ent$
 �0,12)hdra$,hdrb$
 �23,9)a%
" � a%<=0 � �dz@ � �
,�
6:
@� �sort
J% � a% � 100<>0 � �notcent � �cent
T�
^:
h� �notcent
r" � a% � 4<>0 � flag=� � flag=�
|�
�:
�� �cent
�$ � a% � 400<>0 � flag=� � flag=�
��
�:
�� �result:�
� �13,6)res$;a%
�' � flag � �13,8)ilp$ � �10,8)nlp$
��
�:
�� �exit
� �8,18)end$
� a$=�400
 � a$="Y" � a%=0
�
�
00000000  0d 00 0a 27 f4 20 4c 65  61 70 20 59 65 61 72 20  |...'. Leap Year |
00000010  63 68 65 63 6b 65 72 20  66 72 6f 6d 20 52 6f 79  |checker from Roy|
00000020  20 57 61 72 6e 65 72 0d  00 14 1e f4 20 43 68 65  | Warner..... Che|
00000030  63 6b 73 20 66 6f 72 20  61 20 6c 65 61 70 20 79  |cks for a leap y|
00000040  65 61 72 73 2e 0d 00 1e  0f 20 f2 63 6f 6e 73 74  |ears..... .const|
00000050  61 6e 74 73 0d 00 28 06  eb 36 0d 00 32 05 f5 0d  |ants..(..6..2...|
00000060  00 3c 09 f2 79 65 61 72  0d 00 46 09 f2 73 6f 72  |.<..year..F..sor|
00000070  74 0d 00 50 0b f2 72 65  73 75 6c 74 0d 00 5a 09  |t..P..result..Z.|
00000080  f2 65 78 69 74 0d 00 64  0c fd 20 61 25 3d 30 3a  |.exit..d.. a%=0:|
00000090  db 0d 00 6e 05 e0 0d 00  78 05 3a 0d 00 82 10 dd  |...n....x.:.....|
000000a0  20 f2 63 6f 6e 73 74 61  6e 74 73 0d 00 8c 1e 20  | .constants.... |
000000b0  6e 6c 70 24 3d 22 49 73  20 6e 6f 74 20 61 20 6c  |nlp$="Is not a l|
000000c0  65 61 70 20 79 65 61 72  22 0d 00 96 1a 20 69 6c  |eap year".... il|
000000d0  70 24 3d 22 49 73 20 61  20 6c 65 61 70 20 79 65  |p$="Is a leap ye|
000000e0  61 72 22 0d 00 a0 33 20  68 64 72 61 24 3d 22 44  |ar"...3 hdra$="D|
000000f0  65 74 65 63 74 73 20 6c  65 61 70 20 79 65 61 72  |etects leap year|
00000100  73 2e 20 49 6e 20 61 63  63 6f 72 64 61 6e 63 65  |s. In accordance|
00000110  20 77 69 74 68 22 0d 00  aa 1f 20 68 64 72 62 24  | with".... hdrb$|
00000120  3d 22 63 75 72 72 65 6e  74 20 6b 6e 6f 77 6c 65  |="current knowle|
00000130  64 67 65 21 22 0d 00 b4  1a 20 79 72 24 3d 22 67  |dge!".... yr$="g|
00000140  69 76 65 20 6d 65 20 61  20 79 65 61 72 3f 22 0d  |ive me a year?".|
00000150  00 be 16 20 65 6e 74 24  3d 22 45 6e 74 65 72 20  |... ent$="Enter |
00000160  79 65 61 72 22 0d 00 c8  15 20 72 65 73 24 3d 22  |year".... res$="|
00000170  54 68 65 20 79 65 61 72  20 22 0d 00 d2 24 20 65  |The year "...$ e|
00000180  6e 64 24 3d 22 46 69 6e  69 73 68 65 64 3f 20 54  |nd$="Finished? T|
00000190  68 65 6e 20 74 79 70 65  20 61 20 59 2e 22 0d 00  |hen type a Y."..|
000001a0  dc 05 e1 0d 00 e6 05 3a  0d 00 f0 0d dd 20 f2 79  |.......:..... .y|
000001b0  65 61 72 3a db 0d 00 fa  0f 20 f1 8a 31 33 2c 36  |ear:..... ..13,6|
000001c0  29 79 72 24 0d 01 04 10  20 f1 8a 31 32 2c 39 29  |)yr$.... ..12,9)|
000001d0  65 6e 74 24 0d 01 0e 17  20 f1 8a 30 2c 31 32 29  |ent$.... ..0,12)|
000001e0  68 64 72 61 24 2c 68 64  72 62 24 0d 01 18 0e 20  |hdra$,hdrb$.... |
000001f0  e8 8a 32 33 2c 39 29 61  25 0d 01 22 18 20 e7 20  |..23,9)a%..". . |
00000200  61 25 3c 3d 30 20 8c 20  e5 8d 64 7a 40 20 8b 20  |a%<=0 . ..dz@ . |
00000210  e1 0d 01 2c 05 e1 0d 01  36 05 3a 0d 01 40 0b dd  |...,....6.:..@..|
00000220  20 f2 73 6f 72 74 0d 01  4a 25 20 e7 20 61 25 20  | .sort..J% . a% |
00000230  83 20 31 30 30 3c 3e 30  20 8c 20 f2 6e 6f 74 63  |. 100<>0 . .notc|
00000240  65 6e 74 20 8b 20 f2 63  65 6e 74 0d 01 54 05 e1  |ent . .cent..T..|
00000250  0d 01 5e 05 3a 0d 01 68  0e dd 20 f2 6e 6f 74 63  |..^.:..h.. .notc|
00000260  65 6e 74 0d 01 72 22 20  e7 20 61 25 20 83 20 34  |ent..r" . a% . 4|
00000270  3c 3e 30 20 8c 20 66 6c  61 67 3d a3 20 8b 20 66  |<>0 . flag=. . f|
00000280  6c 61 67 3d b9 0d 01 7c  05 e1 0d 01 86 05 3a 0d  |lag=...|......:.|
00000290  01 90 0b dd 20 f2 63 65  6e 74 0d 01 9a 24 20 e7  |.... .cent...$ .|
000002a0  20 61 25 20 83 20 34 30  30 3c 3e 30 20 8c 20 66  | a% . 400<>0 . f|
000002b0  6c 61 67 3d a3 20 8b 20  66 6c 61 67 3d b9 0d 01  |lag=. . flag=...|
000002c0  a4 05 e1 0d 01 ae 05 3a  0d 01 b8 0f dd 20 f2 72  |.......:..... .r|
000002d0  65 73 75 6c 74 3a db 0d  01 c2 13 20 f1 8a 31 33  |esult:..... ..13|
000002e0  2c 36 29 72 65 73 24 3b  61 25 0d 01 cc 27 20 e7  |,6)res$;a%...' .|
000002f0  20 66 6c 61 67 20 8c 20  f1 8a 31 33 2c 38 29 69  | flag . ..13,8)i|
00000300  6c 70 24 20 8b 20 f1 8a  31 30 2c 38 29 6e 6c 70  |lp$ . ..10,8)nlp|
00000310  24 0d 01 d6 05 e1 0d 01  e0 05 3a 0d 01 ea 0b dd  |$.........:.....|
00000320  20 f2 65 78 69 74 0d 01  f4 10 20 f1 8a 38 2c 31  | .exit.... ..8,1|
00000330  38 29 65 6e 64 24 0d 01  fe 0c 20 61 24 3d bf 34  |8)end$.... a$=.4|
00000340  30 30 0d 02 08 14 20 e7  20 61 24 3d 22 59 22 20  |00.... . a$="Y" |
00000350  8c 20 61 25 3d 30 0d 02  12 05 e1 0d ff           |. a%=0.......|
0000035d
P/leap.m0
P/leap.m1
P/leap.m2
P/leap.m4
P/leap.m5