Conjugate a Latin verb: Difference between revisions
Content added Content deleted
(→{{header|Wren}}: Added an extended version.) |
(Added Algol 68) |
||
Line 14: | Line 14: | ||
</pre> |
</pre> |
||
<br><br> |
<br><br> |
||
=={{header|ALGOL 68}}== |
|||
<lang algol68>BEGIN # print some Latin verb conjugations # |
|||
# prints the cojugations of lv or an error message if we don't know how to conjugate lv # |
|||
PROC print conjugations = ( STRING lv )VOID: |
|||
IF INT length = ( UPB lv + 1 ) - LWB lv; |
|||
length < 4 |
|||
THEN |
|||
print( ( """", lv, """ is too short to conjugate", newline ) ) |
|||
ELIF lv[ UPB lv - 2 : ] /= "are" |
|||
THEN |
|||
print( ( "Don't know how to conjugate """, lv, """", newline ) ) |
|||
ELSE |
|||
[]STRING suffix = ( "o", "as", "at", "amus", "atis", "ant" ); |
|||
STRING prefix = lv[ : UPB lv - 2 ]; |
|||
print( ( "Conjugations of """, lv, """:", newline ) ); |
|||
FOR i FROM LWB suffix TO UPB suffix DO |
|||
print( ( " ", prefix, suffix[ i ], newline ) ) |
|||
OD |
|||
FI # print confugations # ; |
|||
print conjugations( "amare" ); |
|||
print conjugations( "veni" ); |
|||
print conjugations( "dare" ); |
|||
print conjugations( "are" ) |
|||
END</lang> |
|||
{{out}} |
|||
<pre> |
|||
Conjugations of "amare": |
|||
amao |
|||
amaas |
|||
amaat |
|||
amaamus |
|||
amaatis |
|||
amaant |
|||
Don't know how to conjugate "veni" |
|||
Conjugations of "dare": |
|||
dao |
|||
daas |
|||
daat |
|||
daamus |
|||
daatis |
|||
daant |
|||
"are" is too short to conjugate |
|||
</pre> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
Checks were also made to ensure the Latin verb has only Latin letters (upper and/or lower case). |
Checks were also made to ensure the Latin verb has only Latin letters (upper and/or lower case). |