Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
|
|
@ -1,9 +1,7 @@
|
|||
# PROC to suffix a number with st, nd, rd or th as appropriate #
|
||||
PROC nth = ( INT number )STRING:
|
||||
BEGIN
|
||||
|
||||
INT number mod 100 = number MOD 100;
|
||||
|
||||
# RESULT #
|
||||
whole( number, 0 )
|
||||
+ IF number mod 100 >= 10 AND number mod 100 <= 20
|
||||
|
|
@ -29,21 +27,20 @@ BEGIN
|
|||
FOR test value FROM from TO to
|
||||
DO
|
||||
STRING test result = nth( test value );
|
||||
print( ( " "[ 1 : 8 - UPB test result ], nth( test value ) ) );
|
||||
print( ( " "[ 1 : 8 - UPB test result ], test result ) );
|
||||
test count +:= 1;
|
||||
IF test count MOD 8 = 0
|
||||
THEN
|
||||
print( ( newline ) )
|
||||
FI
|
||||
OD;
|
||||
IF test count MOD 8 /= 0
|
||||
THEN
|
||||
print( ( newline ) )
|
||||
FI;
|
||||
print( ( newline ) )
|
||||
END; # test nth #
|
||||
|
||||
|
||||
main: (
|
||||
|
||||
test nth( 0, 25 );
|
||||
test nth( 250, 265 );
|
||||
test nth( 1000, 1025 )
|
||||
|
||||
)
|
||||
test nth( 0, 25 );
|
||||
test nth( 250, 265 );
|
||||
test nth( 1000, 1025 )
|
||||
|
|
|
|||
28
Task/Nth/FutureBasic/nth.basic
Normal file
28
Task/Nth/FutureBasic/nth.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue