Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Letter-frequency/XPL0/letter-frequency.xpl0
Normal file
19
Task/Letter-frequency/XPL0/letter-frequency.xpl0
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
include c:\cxpl\codes; \intrinsic 'code' declarations
|
||||
int A(256), C, I;
|
||||
[for C:= 0 to 256-1 do A(C):= 0;
|
||||
repeat C:= ChIn(1); \device 1 doesn't buffer nor echo chars
|
||||
A(C):= A(C)+1; \count character
|
||||
until C=\EOF\$1A;
|
||||
C:= 0;
|
||||
for I:= 0 to 128-1 do \only show 7-bit ASCII
|
||||
[ChOut(0, \tab\9);
|
||||
case C of
|
||||
$0A: ChOut(6, $19); \line feed = down arrow
|
||||
$0D: ChOut(6, $1B) \carriage return = left arrow
|
||||
other ChOut(6, C); \all other characters display on device 6
|
||||
ChOut(0, ^ );
|
||||
IntOut(0, A(C)); \show count
|
||||
C:= C+16; \columnar order
|
||||
if (I&7) = 7 then [CrLf(0); C:= C-8*16+1];
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue