Debian Codegraph @

Data_Generators/makedata/makename.pas

raw
1 program makenames;
2 (********************************************************************
3 This file is part of Ironseed.
4
5 Ironseed is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ironseed is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ironseed. If not, see <https://www.gnu.org/licenses/>.
17 ********************************************************************)
18
19 {*********************************************
20 Data Generator: create random names
21
22 Copyright:
23 1994 Channel 7, Destiny: Virtual
24 2020 Matija Nalis <[email protected]>
25 **********************************************}
26
27 {$PACKRECORDS 1}
28
29 var
30 j,a,b: integer;
31 name: string[13];
32 last: char;
33
34 begin
35 RANDOMIZE;
36 for j:=1 to 5000 do
37 begin
38 a:=1;
39 b:=random(11) + 3;
40 if random(2)=0 then last:='A' else last:='B';
41 name[0]:=chr(b);
42 repeat
43 case last of
44 'A','E','I','O','U','Y': last:=chr(random(26)+65);
45 'Q': last:='U';
46 else
47 begin
48 last:=' ';
49 while last=' ' do
50 begin
51 last:=chr(random(26)+65);
52 case last of
53 'A','E','I','O','U','Y':;
54 else last:=' ';
55 end;
56 end;
57 end;
58 end;
59 name[a]:=last;
60 inc(a);
61 until a=b;
62 writeln(name);
63 end;
64 end.