Does any of the great gods have a Web site like a fun test?

Source: Internet
Author: User
Online a lot, like what fortune-telling Ah, look at your next life or something
is to enter the same person name, the result is the same,
I want to be a, but I don't know the data structure, and how the program is designed,
Enter the same word, the result must be the same,
I would like to make a list, but think of this record table, how big ah, headache!


Reply to discussion (solution)

You look at the idea, okay, come in a name first go to the database to find, if it already exists, take out the results, if not, randomly to the results, and coexist into the database. If you want to be more perfect, put a layer of cache redis or memcache in the middle.

Pseudoscience!
The output is randomly generated.

Pseudo-random number generator Rand is a seed that can be seeded, and the same seed will produce the same pseudo-random number sequence
As a result, you just need to make the incoming data a seed.

Srand (Hexdec (MD5 ($input, 1)));
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.