|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--project0.LuckTester
Does the God/Godess of Luck know you? A class to help answer this urgent question.
Constructor Summary | |
LuckTester()
Creates a new instance of LuckTester |
Method Summary | |
boolean |
checkInitials(java.lang.String initials)
Check that a pair of initials is suitable for presentation to the God/Goddess of Luck. |
int |
tryUntilSuccess(java.lang.String initials)
Given a person's initials, how long does it take the God/Goddess of luck to recognize that person? Algorithm: Generate pairs of characters randomly until the desired initials are observed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LuckTester()
Method Detail |
public boolean checkInitials(java.lang.String initials)
initials
- A person's initials: must be exactly two uppercase English letters.
public int tryUntilSuccess(java.lang.String initials)
initials
- A string of exactly two uppercase alphabetic characters;
invalid initials risk inciting the wrath of the gods.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |