RosettaCodeData/Task/Nth/FutureBasic/nth.basic

29 lines
457 B
Plaintext

CFStringRef local fn Suffix( n as int )
if ( n % 100 / 10 == 1 ) then exit fn
select ( n % 10 )
case 1 : return @"st"
case 2 : return @"nd"
case 3 : return @"rd"
end select
end fn = @"th"
void local fn DoIt
int i
for i = 0 to 25
print i;fn Suffix(i);@" ";
next
print
for i = 250 to 265
print i;fn Suffix(i);@" ";
next
print
for i = 1000 to 1025
print i;fn Suffix(i);@" ";
next
end fn
fn DoIt
HandleEvents