Conjugate a Latin verb: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) mNo edit summary |
(Added Wren) |
||
Line 12: | Line 12: | ||
amatis |
amatis |
||
amant |
amant |
||
</pre> |
|||
<br><br> |
|||
=={{header|Wren}}== |
|||
<lang ecmascript>var conjugate = Fn.new { |infinitive| |
|||
if (!infinitive.endsWith("are")) Fiber.abort("Not a first conjugation verb.") |
|||
var stem = infinitive[0..-4] |
|||
System.print("Present indicative tense of '%(infinitive)':") |
|||
for (ending in ["o", "as", "at", "amus", "atis", "ant"]) { |
|||
System.print(" " + stem + ending) |
|||
} |
|||
System.print() |
|||
} |
|||
for (infinitive in ["amare", "dare"]) conjugate.call(infinitive)</lang> |
|||
{{out}} |
|||
<pre> |
|||
Present indicative tense of 'amare': |
|||
amo |
|||
amas |
|||
amat |
|||
amamus |
|||
amatis |
|||
amant |
|||
Present indicative tense of 'dare': |
|||
do |
|||
das |
|||
dat |
|||
damus |
|||
datis |
|||
dant |
|||
</pre> |
</pre> |
Revision as of 17:50, 16 September 2021
Conjugate a Latin verb
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses
- Task
- Given the input: "amare", output the following, each on its own line:
amo amas amat amamus amatis amant
Wren
<lang ecmascript>var conjugate = Fn.new { |infinitive|
if (!infinitive.endsWith("are")) Fiber.abort("Not a first conjugation verb.") var stem = infinitive[0..-4] System.print("Present indicative tense of '%(infinitive)':") for (ending in ["o", "as", "at", "amus", "atis", "ant"]) { System.print(" " + stem + ending) } System.print()
}
for (infinitive in ["amare", "dare"]) conjugate.call(infinitive)</lang>
- Output:
Present indicative tense of 'amare': amo amas amat amamus amatis amant Present indicative tense of 'dare': do das dat damus datis dant