# FLAMES (game)

FLAMES or FLAME is a paper-and-pencil game popular among school-aged children, which is theoretically related to the Josephus problem and other counting-out games. FLAMES or FLAME is an acronym for the possible outcomes of the game. In order, they are:
* F: friends (or friendship)
* L: lovers (or love)
* A: affectionate (or affection)
* M: marriage
* E: enemies
* S: siblings (or sister): it may be omitted in some variations
This game is played to predict the future relationship between a person and their crush (or celebrity crush). If a player does not achieve the desired outcome, they may retry with different variations of their names to influence the outcome. The reactions to the game's outcome may reveal a player's true feelings toward the person they are paired with. The game, however, does not accurately predict the true relationship between any two persons.

## Gameplay

The gameplay of FLAMES (or FLAME) has the following steps:
* Write your and your crush's name on a sheet of paper.
* Cross out any common letter that appears in both the names. If the common letter(s) appears uneven times in the two names, all of its occurrences in both names may be crossed, or just as many occurrences that are common in the two may be crossed, depending on the variant of play.
* Count the total number of remaining letters in the two names. Let it be $n$.
* Write "FLAMES" (or "FLAME") on a sheet of paper.
    There are two alternate variations of the last stage of the game:
* Start counting the letters of "FLAMES" one-by-one, until you reach $n$. If $n$ is greater than 6, wrap-around and continue counting through "FLAMES". Repeat as many times as necessary until you reach $n$.The ending letter ($n$th letter) gives you the future relationship between you and your crush.
* Start counting the letters of "FLAMES" (or what remains of it) one-by-one, until you reach $n$. If you don't, wrap-around and continue counting. Repeat as many times as necessary until you count until $n$.Cross out the $n$th letter.Repeat steps 5 and 6 with the remaining letters of "FLAMES", starting with the next letter, until only one letter remains.The letter remaining at the end gives the future relationship between you and your crush. This variant of FLAMES is equivalent to the Josephus problem. Due to this reason, its implementation is popular among beginner programmers.
Although not part of the gameplay, when a player gets an unsatisfactory outcome such as "E" or "S", they may retry with different variations of their names, such as full names, initialled names, etc. This may reveal a player's true feelings toward the person they are paired with.

### Example

Consider a "FLAMES" example of the Josephus problem variant.
* Take two names "ROHAN" and "LENNA".
* After crossing out common letters, "ROH" and "LEN" is left.
* Total number of remaining letters in the two names is 6.
* Write "FLAMES".
* Cross out the 6th letter "S". Repeat counting, starting from F, on what remains of "FLAMES", i.e., "FLAME".
* Cross out the new 6th letter "F". Repeat counting, starting from L, on "LAME".
* Cross out the new 6th letter "A". Repeat counting, starting from M, on "LME".
* Cross out the new 6th letter "L". Repeat counting, starting from M, on "ME".
* Cross out the new 6th letter "E". Only "M" remains of "FLAMES".
* The future relationship between "ROHAN" and "LENNA" is "Marriage".

### Code implementation

The following is a possible pythonic implementation of the Josephus problem variant:

## In popular culture

* The coming-of-age series Flames, is named after this game. The game is also featured in promotional materials of the series.
* In episode 4 of season 1 of ImMature, Susu attempts to clear Dhruv's confusion about his relationship with Chhavi by playing FLAMES.