Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/The-Name-Game/XPL0/the-name-game.xpl0
Normal file
31
Task/The-Name-Game/XPL0/the-name-game.xpl0
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
proc PrintVerse(Name);
|
||||
char Name;
|
||||
int I, Vowel;
|
||||
|
||||
proc PrintLine(Str, Let);
|
||||
int Str, Let;
|
||||
[Text(0, Str);
|
||||
if Name(0) # Let then ChOut(0, Let!$20); \bary
|
||||
if Vowel then ChOut(0, Name(0)!$20); \earl
|
||||
Text(0, Name+1);
|
||||
CrLf(0);
|
||||
];
|
||||
|
||||
[Name(0):= Name(0) & ~$20; \to uppercase
|
||||
I:= 1;
|
||||
while Name(I) do \to lowercase
|
||||
[Name(I):= Name(I) ! $20; I:= I+1];
|
||||
case Name(0) of
|
||||
^A,^E,^I,^O,^U: Vowel:= true
|
||||
other Vowel:= false;
|
||||
Text(0, Name); Text(0, ", "); Text(0, Name);
|
||||
PrintLine(", bo-", ^B);
|
||||
PrintLine("Banana-fana fo-", ^F);
|
||||
PrintLine("Fee-fi-mo-", ^M);
|
||||
Text(0, Name); Text(0, "!^m^j^m^j");
|
||||
];
|
||||
|
||||
int Names, I;
|
||||
[Names:= ["gARY", "Earl", "Billy", "Felix", "Mary", "sHIRley"];
|
||||
for I:= 0 to 6-1 do PrintVerse(Names(I));
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue