Dating agency: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: no 'say') |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 19: | Line 19: | ||
This task is intended as a bit of fun as well as a simple exercise in object modelling so hopefully it won't offend anyone! |
This task is intended as a bit of fun as well as a simple exercise in object modelling so hopefully it won't offend anyone! |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
{{trans|Python}} |
|||
<lang 11l>V sailors = [‘Adrian’, ‘Caspian’, ‘Dune’, ‘Finn’, ‘Fisher’, ‘Heron’, ‘Kai’, ‘Ray’, ‘Sailor’, ‘Tao’] |
|||
V ladies = [‘Ariel’, ‘Bertha’, ‘Blue’, ‘Cali’, ‘Catalina’, ‘Gale’, ‘Hannah’, ‘Isla’, ‘Marina’, ‘Shelly’] |
|||
F isnicegirl(s) |
|||
R Int(s[0].code) % 2 == 0 |
|||
F islovable(slady, ssailor) |
|||
R Int(slady.last.code) % 2 == Int(ssailor.last.code) % 2 |
|||
L(lady) ladies |
|||
I isnicegirl(lady) |
|||
print(‘Dating service should offer a date with ’lady) |
|||
L(sailor) sailors |
|||
I islovable(lady, sailor) |
|||
print(‘ Sailor ’sailor‘ should take an offer to date her.’) |
|||
E |
|||
print(‘Dating service should NOT offer a date with ’lady)</lang> |
|||
{{out}} |
|||
<pre> |
|||
Dating service should NOT offer a date with Ariel |
|||
Dating service should offer a date with Bertha |
|||
Sailor Dune should take an offer to date her. |
|||
Sailor Kai should take an offer to date her. |
|||
Sailor Ray should take an offer to date her. |
|||
Sailor Tao should take an offer to date her. |
|||
Dating service should offer a date with Blue |
|||
Sailor Dune should take an offer to date her. |
|||
Sailor Kai should take an offer to date her. |
|||
Sailor Ray should take an offer to date her. |
|||
Sailor Tao should take an offer to date her. |
|||
Dating service should NOT offer a date with Cali |
|||
Dating service should NOT offer a date with Catalina |
|||
Dating service should NOT offer a date with Gale |
|||
Dating service should offer a date with Hannah |
|||
Sailor Adrian should take an offer to date her. |
|||
Sailor Caspian should take an offer to date her. |
|||
Sailor Finn should take an offer to date her. |
|||
Sailor Fisher should take an offer to date her. |
|||
Sailor Heron should take an offer to date her. |
|||
Sailor Sailor should take an offer to date her. |
|||
Dating service should NOT offer a date with Isla |
|||
Dating service should NOT offer a date with Marina |
|||
Dating service should NOT offer a date with Shelly |
|||
</pre> |
|||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
{{works with|Factor|0.99 2021-06-02}} |
{{works with|Factor|0.99 2021-06-02}} |