C++高手进来帮帮忙

来源:百度知道 编辑:UC知道 时间:2024/06/15 01:32:51
Typing speed game

You are to implement a game that tests a user's typing speed. The game randomly generates a permutation of the 26 lower case letters of the alphabet. Scoring is based on the time it takes for the user to correctly enter the string.

Rules and requirements

Random permutation should be generated via calls to srand() and rand().
Seed srand() using the usec field from a call to gettimeofday().
Each permutation of the 26 letters should be possible
Ensure that your random permutation is generated using a minimal number of rand() calls

Use timer macro "timersub()" for handling operations on struct timevals (/usr/include/sys/time.h)
Timing should begin when the random permutation is first given to the user
Timing should end when the user correctly inputs the permutation correctly.
Hints and suggestions

Consult the linux man pages for more information on rand()/srand(), ge

有一段 示例文字存在 char example[] = "Please Type This Example Text.";
开始计时保存个GetTickCount处理字符案件消息,判断与当前要打的字符是否相等,做计数,全打完了用TickCount - 起始时间 然后算一下不就出来了

就是最常见的打字练习软件