In the reign of Kangxi in the Qing dynasty, there was a talented and erudite man named Xiaotang Ji who, despite his great talents, never managed to place first in the civil exam because he was too poor to bribe the officials in charge of the exam. In his frustration, Xiaotang Ji decided to become a Buddhist monk.
Afterwards, there was another talented young man named Qinglong Zuo, who also failed to place first in the civil exam despite his learning. When Xiaotang Ji urged him to become a monk, he replied,”If I can only place first in the civil exam and be an official for one day, it'll prove that I haven't studied in vain all these years.” One day Xiaotang Ji and Qinglong Zuo were strolling together, and they stopped under the shade of a locust tree. Qinglong Zuo fell asleep under the tree and dreamed that he was a great general in the Black Water Kingdom. He then attacked the Yellow Ant Kingdom and became the king of that country.
When Qinglong woke up, Xiaotang again urged him to become a monk, but he still refused. Xiaotang said to him,“You should be satisfied by now. You've been both a great general and the king of the Yellow Ant Kingdom. What are you waiting for? There are black ants next to the place where you dozed off, and so you became the general of the Black Water Kingdom. When you turned over, your head rolled onto some yellow ants, and so you become the king of the Yellow Ant Kingdom.” Qinglong took a look and found that indeed there were black and yellow ants near the place where he had taken a nap. He immediately had an insight that life is but a dream and nothing is real. In the end Qinglong Zuo and Xiaotang Ji both became monks.