Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
include c:\cxpl\stdlib;
|
||||
char Dict(10,10);
|
||||
int Entries;
|
||||
|
||||
proc AddEntry(Letter, Greek); \Insert entry into associative array
|
||||
char Letter, Greek;
|
||||
[Dict(Entries,0):= Letter;
|
||||
StrCopy(Greek, @Dict(Entries,1));
|
||||
Entries:= Entries+1; \(limit checks ignored for simplicity)
|
||||
];
|
||||
|
||||
func Lookup(Greek); \Given Greek name return English letter
|
||||
char Greek;
|
||||
int I;
|
||||
[for I:= 0, Entries-1 do
|
||||
if StrCmp(Greek, @Dict(I,1)) = 0 then return Dict(I,0);
|
||||
return ^?;
|
||||
];
|
||||
|
||||
[Entries:= 0;
|
||||
AddEntry(^A, "alpha");
|
||||
AddEntry(^D, "delta");
|
||||
AddEntry(^B, "beta");
|
||||
AddEntry(^C, "gamma");
|
||||
ChOut(0, Lookup("beta")); CrLf(0);
|
||||
ChOut(0, Lookup("omega")); CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue