General FizzBuzz: Difference between revisions

Added XPL0 example.
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(Added XPL0 example.)
Line 4,388:
13
Bazz
FizzBuzz
16
17
Fizz
19
Buzz
</pre>
 
=={{header|XPL0}}==
<syntaxhighlight lang "XPL0">string 0; \use zero-terminated strings
 
proc GetString(S); \Get string (S) from user
char S;
[loop [S(0):= ChIn(0);
if S(0) = $0D \CR\ then quit;
S:= S+1;
];
S(0):= 0; \replace CR with terminator
];
 
int Limit, I, Factor(3), Str(3,40), F(3), N;
[Limit:= IntIn(0);
for I:= 0 to 2 do
[Factor(I):= IntIn(0);
GetString(Str(I));
F(I):= 0;
];
for N:= 1 to Limit do
[for I:= 0 to 2 do
[F(I):= F(I)+1;
if F(I) >= Factor(I) then
[Text(0, Str(I));
F(I):= 0;
];
];
if F(0)*F(1)*F(2) # 0 then IntOut(0, N);
CrLf(0);
];
]</syntaxhighlight>
{{out}}
<pre>
20
3 Fizz
5 Buzz
7 Baxx
1
2
Fizz
4
Buzz
Fizz
Baxx
8
Fizz
Buzz
11
Fizz
13
Baxx
FizzBuzz
16
297

edits