Check out the implementation in Python here: AmruthPillai/FlamesAlgorithm-Python
Check out the implementation in Java/Android here: AmruthPillai/FlamesAlgorithm-Android
The game of FLAMES is apparently a popular game played by teenagers as a way to deal with the unpredictability of their romantic relationships. This belongs to the vast class of prediction devices such as the counting of petals, numerological tricks, horoscopes and the like. However, unlike many of these other methods, the FLAMES game is based on a transparent deterministic algorithm.
The rules of the FLAMES game can be described as follows. Take the names of two people, usually of opposite genders, and cross out all the common letters in the two names. Count the total number of letters that remain in both names after this procedure. Let this number of mismatches be m.
Now write FLAMES on a piece of paper. Count through the letters of this string starting from F to S and cycling back through F till m letters have been counted. At this point, cross out the letter in FLAMES at which the count ends (say A). Restart counting from the next letter (here M) through the string FLMES. Repeat this till five of the letters of FLAMES have been crossed out and only one letter remains.
The final letter that remains is the predicted nature of the relationship between the two people whose names were initially chosen, where F = “Friend”, L = “Love”, A = “Affection”, M = “Marriage”, E = “Enemy”, S = “Sibling”. The rationale (or the lack of it) for these interpretations is beyond the scope of this repository.
Step 1: ReadName Procedure
yourName & partnerName, respectivelyyourNameLength & partnerNameLength respectivelyStep 2: EliminateCommonCharacters Procedure
FOR i in every character in yourName till yourNameLengthFOR j in every character in partnerName till partnerNameLength
IF a character yourName[i] is equal to a character in partnerName[j] THENyourName and partnerNameEND IF
2. END FOREND FORcompleteName and calculate the length of it to be stored in completeNameLengthStep 3: FlamesCalculation Procedure
FLAMES and store it's length of 6 in a variable flamesLengthindex to store the index of the character to be striked outFLAMES is not equal to 1, do the following:index <- completeNameLength % flamesLengthIF (index == 0) THENFLAMESELSEindex is currently pointing toward in FLAMESFLAMES from (index) to end, and another substring from start to (index). Concatenate the two substrings and overwrite FLAMESEND IFflamesLength by 1END WHILEFLAMES, which we will store in flamesResultStep 4: DisplayResult Procedure
IF flamesResult isF, THENyourName & partnerName are friends!"L, THENyourName & partnerName are lovers!"A, THENyourName & partnerName are affectionate to each other!"M, THENyourName & partnerName are or will be married!"E, THENyourName & partnerName are enemies!"S, THENyourName & partnerName are or are like siblings!"END IFAmruth A. Pillai - Facebook Profile
Email: im.amruth(at)gmail.com
Prabhu B. - Facebook Profile
Email: im.prabhu(at)gmail.com
15 commits
C++
100.0%
Check out the implementation in Python here: AmruthPillai/FlamesAlgorithm-Python
Check out the implementation in Java/Android here: AmruthPillai/FlamesAlgorithm-Android
The game of FLAMES is apparently a popular game played by teenagers as a way to deal with the unpredictability of their romantic relationships. This belongs to the vast class of prediction devices such as the counting of petals, numerological tricks, horoscopes and the like. However, unlike many of these other methods, the FLAMES game is based on a transparent deterministic algorithm.
The rules of the FLAMES game can be described as follows. Take the names of two people, usually of opposite genders, and cross out all the common letters in the two names. Count the total number of letters that remain in both names after this procedure. Let this number of mismatches be m.
Now write FLAMES on a piece of paper. Count through the letters of this string starting from F to S and cycling back through F till m letters have been counted. At this point, cross out the letter in FLAMES at which the count ends (say A). Restart counting from the next letter (here M) through the string FLMES. Repeat this till five of the letters of FLAMES have been crossed out and only one letter remains.
The final letter that remains is the predicted nature of the relationship between the two people whose names were initially chosen, where F = “Friend”, L = “Love”, A = “Affection”, M = “Marriage”, E = “Enemy”, S = “Sibling”. The rationale (or the lack of it) for these interpretations is beyond the scope of this repository.
Step 1: ReadName Procedure
yourName & partnerName, respectivelyyourNameLength & partnerNameLength respectivelyStep 2: EliminateCommonCharacters Procedure
FOR i in every character in yourName till yourNameLengthFOR j in every character in partnerName till partnerNameLength
IF a character yourName[i] is equal to a character in partnerName[j] THENyourName and partnerNameEND IF
2. END FOREND FORcompleteName and calculate the length of it to be stored in completeNameLengthStep 3: FlamesCalculation Procedure
FLAMES and store it's length of 6 in a variable flamesLengthindex to store the index of the character to be striked outFLAMES is not equal to 1, do the following:index <- completeNameLength % flamesLengthIF (index == 0) THENFLAMESELSEindex is currently pointing toward in FLAMESFLAMES from (index) to end, and another substring from start to (index). Concatenate the two substrings and overwrite FLAMESEND IFflamesLength by 1END WHILEFLAMES, which we will store in flamesResultStep 4: DisplayResult Procedure
IF flamesResult isF, THENyourName & partnerName are friends!"L, THENyourName & partnerName are lovers!"A, THENyourName & partnerName are affectionate to each other!"M, THENyourName & partnerName are or will be married!"E, THENyourName & partnerName are enemies!"S, THENyourName & partnerName are or are like siblings!"END IFAmruth A. Pillai - Facebook Profile
Email: im.amruth(at)gmail.com
Prabhu B. - Facebook Profile
Email: im.prabhu(at)gmail.com
15 commits
C++
100.0%