📄 fortune1.cpp
字号:
// Get needed include files
#include "Fortune1.h"
#include "Utility.h"
// Our list of fortunes
static string g_astrFortunes[] =
{
"You are strong in body and spirit.",
"You are strong in perspiration and odor.",
"Good fortune smiles upon the distributed.",
"VB Programmer for Hire -- Cheap!!",
"I never met an object I didn't like.",
"Edit, Compile, Link, Crash, Sigh.",
"Never judge a stack dump by its arguments.",
"Card carrying member of the Bug Police.",
"You make Dilbert look charming and sophisticated.",
"BMW, The Ultimate Driving Machine."
};
// Constant that tracks the number of fortunes we know about
static const ULONG g_ulNumFortunes =
sizeof(g_astrFortunes) / sizeof(string);
// Constructor
CFortuneTeller::CFortuneTeller()
{
// Seed the random number generator
SeedRandomGenerator();
}
// Lone public method
string CFortuneTeller::GetFortune()
{
return g_astrFortunes[rand() % g_ulNumFortunes];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -