To find the total number of licorice ropes \( r \) in the bag, we start by analyzing the situation described in the problem:
- There are 8 students.
- Each student receives 4 licorice ropes.
To find the total number of licorice ropes \( r \), we can set up the equation based on the distribution:
\[ r = 8 \times 4 \]
Now, we solve the equation:
\[ r = 32 \]
Thus, the number of licorice ropes that came in the bag is \( \boxed{32} \).