本文整理汇总了C++中print2函数的典型用法代码示例。如果您正苦于以下问题:C++ print2函数的具体用法?C++ print2怎么用?C++ print2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: l_water
/* various miscellaneous location functions */
void l_water(void)
{
if (! gamestatusp(MOUNTED)) {
if ((Player.possessions[O_ARMOR] != NULL)) {
print1("Your heavy armor drags you under the water!");
morewait();
p_drown();
print2("You reach the surface again.");
}
else if (Player.itemweight > ((int) (Player.maxweight / 2))) {
print1("The weight of your burden drags you under water!");
morewait();
p_drown();
print2("You reach the surface again.");
}
else switch(random_range(32)) {
case 0:print1("Splish. Splash!"); break;
case 1:print1("I want my ducky!"); break;
case 2:print1("So finally you take a bath!"); break;
case 3:print1("You must be very thirsty!"); break;
}
}
else switch(random_range(32)) {
case 0:print1("Your horse frolics playfully in the water."); break;
case 1:print1("Your horse quenches its thirst."); break;
case 2:print1("Your steed begins to swim...."); break;
case 3:print1("Your mount thrashes about in the water."); break;
}
}
开发者ID:anylonen,项目名称:omega,代码行数:30,代码来源:move.c
示例2: l_vault
void l_vault(void)
{
print1("You come to a thick vault door with a complex time lock.");
if ((hour()==23)) {
print2("The door is open.");
Level->site[12][56].locchar = FLOOR;
}
else {
print2("The door is closed.");
Level->site[12][56].locchar = WALL;
morewait();
clearmsg();
if (cinema_confirm("You're about to try to crack the safe.")=='y') {
if (random_range(100) < Player.rank[THIEVES]*Player.rank[THIEVES]) {
print2("The lock clicks open!!!");
gain_experience(5000);
Level->site[12][56].locchar = FLOOR;
}
else {
print2("Uh, oh, set off the alarm.... The castle guard arrives....");
morewait();
if (Player.rank[NOBILITY] == DUKE) {
clearmsg();
print1("\"Ah, just testing us, your Grace? I hope we're up to scratch.\"");
morewait();
}
else
send_to_jail();
}
}
else print2("Good move.");
}
}
开发者ID:albert-wang,项目名称:OmegaRPG,代码行数:33,代码来源:site2.c
示例3: print2
void Binary::print2(node*temp,int x,int y)
{
if(temp)
{
if(y==1)
{
print2(temp->left,25,y+1);
gotoxy(x,(y*2)+5);
cout<<temp->data;
print2(temp->right,55,y+1);
}
else
{
print2(temp->left,x-(10-(1.7*y)),y+1);
gotoxy(x,(y*2)+5);
cout<<temp->data;
print2(temp->right,x+(10-(1.7*y)),y+1);
}
}
}
开发者ID:Dirker27,项目名称:DataStructures,代码行数:25,代码来源:BINTREE_.CPP
示例4: l_charity
void l_charity(void)
{
long donation;
print2("'Greetings, friend. Do you wish to make a donation?' [yn] ");
if (ynq2()!='y')
print3("'Pinchpurse!'");
else {
clearmsg();
// print1("How much can you give? ");
donation = parsenum("How much can you give?");
if (donation < 1)
print2("'Go stick your head in a pig.'");
else if (donation > Player.cash)
print2("'I'm afraid you're charity is bigger than your purse!'");
else if (donation < max(100,Player.level*Player.level*100)) {
print2("'Oh, can't you do better than that?'");
print3("'Well, I guess we'll take it....'");
if (Player.alignment < 10) Player.alignment++;
Player.cash -= donation;
}
else {
print2("'Oh thank you kindly, friend, and bless you!'");
Player.cash -= donation;
Player.alignment += 5;
}
}
dataprint();
}
开发者ID:albert-wang,项目名称:OmegaRPG,代码行数:28,代码来源:site2.c
示例5: gymtrain
int gymtrain(int *maxstat, int *stat)
{
int trained = 0;
if (Gymcredit + Player.cash < 2000)
print2("You can't afford our training!");
else {
trained = 1;
if (Gymcredit > 2000) Gymcredit -= 2000;
else {
Player.cash -= (2000-Gymcredit);
Gymcredit = 0;
}
print2("Sweat. Sweat. ");
if ((*maxstat < 30) &&
((*maxstat < random_range(30)) || (random_range(3)==1))) {
nprint2("The training pays off!");
(*maxstat)++;
(*stat)++;
}
else {
nprint2("You feel the healthy glow of a good workout.");
if (*stat < *maxstat) {
(*stat)++;
print3("A feeling of rehabilitation washes through you.");
}
}
}
dataprint();
return trained;
}
开发者ID:albert-wang,项目名称:OmegaRPG,代码行数:33,代码来源:site2.c
示例6: drawPanel
void drawPanel(uchar* a) {
drawRect(a, 30, ROWS_CNT + 4);
memset(a + (VIDEO_BPL * (2 + ROWS_CNT) + 1), 0x1C, 29); // hLine
vLine(a + (VIDEO_BPL + 15), ROWS_CNT+1, 0x1B);
print2(a + (VIDEO_BPL + 6 ), "imq");
print2(a + (VIDEO_BPL + 21), "imq");
}
开发者ID:VWarlock,项目名称:86RKSD,代码行数:7,代码来源:interface.c
示例7: stationcheck
void stationcheck(void)
{
int stationsleft=FALSE;
int i,j;
morewait();
clearmsg();
print1("You feel regenerated.");
Player.hp = Player.maxhp;
dataprint();
for(j=0;j<Level->level_length;j++)
for(i=0;i<Level->level_width;i++)
if ((Level->site[i][j].locchar == WATER) ||
(Level->site[i][j].locchar == HEDGE) ||
(Level->site[i][j].locchar == WHIRLWIND) ||
(Level->site[i][j].locchar == FIRE))
stationsleft=TRUE;
if (! stationsleft) {
print1("There is a noise like a wild horse's neigh.");
print2("You spin around, and don't see anyone around at all");
print3("except for a spurred black cloaked figure carrying a scythe.");
morewait();clearmsg();
print1("Death coughs apologetically. He seems a little embarrassed.");
print2("A voice peals out:");
print3("'An Adept must be able to conquer Death himself....");
make_site_monster(32,4,DEATH);
}
}
开发者ID:anylonen,项目名称:omega,代码行数:27,代码来源:move.c
示例8:
void Thermoelasticity2Dp::printX(tInteger p)
{
for(tInteger i=0; i<nx; i++)
std::cout<<std::endl<<p*nx+i<<"\t"<<print2(nodes[p*nx+i].x)<<"\t"<<print2(nodes[p*nx+i].y)<<"\t"<<print(U[p*nx+i])<<"\t"<<print(V[p*nx+i])<<"\t"<<print(T[p*nx+i]);
}
开发者ID:IvanAssing,项目名称:IMC_Thermoelasticity2Dp,代码行数:8,代码来源:thermoelasticity2dp.cpp
示例9: main
int main()
{
std::vector<int> v = {1,23,6,4,5,7,4};
std::list<std::string> l = {"ss","sszz","saaas","s333s","ss2","sss"};
print2(v, std::cout);
print2(l, std::cout);
return 0;
}
开发者ID:184622608,项目名称:CppPrimer,代码行数:9,代码来源:main.cpp
示例10: drawFilesCountInt
void drawFilesCountInt(ulong* total, uint filesCnt) {
uchar v;
uchar* a;
a = charAddr(2+activePanel, 4+ROWS_CNT);
i2s32((char*)a, total, 10, ' ');
print2(a+11, "bajt w ");
if(filesCnt < 1000) i2s((char*)a+18, filesCnt, 3, ' ');
v = filesCnt % 100;
print2(a+22, (!(v >= 10 && v < 20) && v % 10 == 1) ? "fajle " : "fajlah ");
}
开发者ID:VWarlock,项目名称:86RKSD,代码行数:10,代码来源:interface.c
示例11: print2
const std::string Statistics::print() const
{
return std::string(
print2(antCnt_, "ants")+
print2(foodCnt_, "foods")+
print2(obstacleCnt_, "obstacles")+
"ants carring smth = " + std::to_string(antsCarring_) + "\n"+
"step number = " + std::to_string(stepNumber_)+"\n"
);
}
开发者ID:Kamilcuk,项目名称:Anthill,代码行数:10,代码来源:statistics.cpp
示例12: l_void_station
void l_void_station(void)
{
int i,something=FALSE;
if (cinema_confirm("You're about to Peter Pan into an endless void.")=='y') {
if (Level->mlist == NULL) {
print2("You fall forever. Eventually you die of starvation.");
morewait();
while(Player.hp>0) {
Time+=60;
hourly_check();
usleep(250000);
}
}
else {
print1("You enter the void.");
print2("You feel a sudden surge of power from five directions.");
morewait();
something = (Player.packptr > 0);
if (! something)
for(i=0;((i<MAXITEMS)&&(!something));i++)
if (Player.possessions[i] != NULL)
something = TRUE;
if (something) {
print1("The flow of power is disrupted by something!");
print2("The power is unbalanced! You lose control!");
morewait();
print1("Each of your cells explodes with a little scream of pain.");
print2("Your disrupted essence merges with the megaflow.");
p_death("the Power of the Void");
}
else if (! gamestatusp(PREPARED_VOID)){
print1("The hungry void swallows you whole!");
print2("Your being dissipates with a pathetic little sigh....");
p_death("the Emptyness of the Void");
}
else {
print1("The flow of power rages through your body,");
print2("but you manage to master the surge!");
print3("You feel adept....");
morewait();clearmsg();
print1("With a thought, you soar up through the void to the");
print2("place from whence you came.");
print3("As the platform of the Challenge dwindles beneath you");
morewait();
clearmsg();
print1("You see Death raise his scythe to you in a salute.");
Player.rank[ADEPT] = 1;
setgamestatus(COMPLETED_CHALLENGE);
FixedPoints = calc_points();
/* set so change_environment puts player in correct temple! */
Player.x = 49;
Player.y = 59;
print2("You find yourself back in the Temple of Destiny.");
morewait();
change_environment(E_TEMPLE);
}
}
}
else print2("You back away from the edge....");
}
开发者ID:anylonen,项目名称:omega,代码行数:60,代码来源:move.c
示例13: cureforpay
void cureforpay(void)
{
if (Player.cash < 250)
print2("You can't afford to be cured!");
else {
Player.cash -= 250;
Player.status[DISEASED] = 0;
print2("Quarantine lifted....");
showflags();
}
}
开发者ID:albert-wang,项目名称:OmegaRPG,代码行数:11,代码来源:site2.c
示例14: identify
void identify(int blessing)
{
int index;
clearmsg();
if (blessing == 0) {
index = getitem_prompt("Identify: ", NULL_ITEM);
if (index == CASHVALUE) print3("Your money is really money.");
else if (index == ABORT)
State.setSkipMonsters();
else {
if (Player.possessions[index]->objchar == FOOD)
Player.possessions[index]->known = 1;
else {
Player.possessions[index]->known = 2;
Objects[Player.possessions[index]->id].known = 1;
}
print1("Identified: ");
mprint(itemid(Player.possessions[index]));
}
}
else if (blessing < 0) {
print2("You feel forgetful.");
for (index=0; index<MAXITEMS; index++)
if (Player.possessions[index] != NULL) {
Player.possessions[index]->known = 0;
Objects[Player.possessions[index]->id].known = 0;
}
}
else {
print2("You feel encyclopaedic.");
for (index=0; index<MAXITEMS; index++)
if (Player.possessions[index] != NULL) {
if (Player.possessions[index]->objchar == FOOD)
Player.possessions[index]->known = 1;
else {
Player.possessions[index]->known = 2;
Objects[Player.possessions[index]->id].known = 1;
}
}
for (index=0; index<Player.packptr; index++)
if (Player.pack[index] != NULL) {
if (Player.pack[index]->objchar == FOOD)
Player.pack[index]->known = 1;
else {
Player.pack[index]->known = 2;
Objects[Player.pack[index]->id].known = 1;
}
}
}
calc_melee();
}
开发者ID:B-Rich,项目名称:OmegaRPG,代码行数:53,代码来源:effect1.cpp
示例15: make_hp
void make_hp(pob o)
{
print1("A full-scale heavenly choir chants \'Hallelujah\' all around you!");
print2("You notice a change in the symbol you carry...");
switch(Player.patron) {
case ODIN:
*o = Objects[ARTIFACTID + 14];
break;
case SET:
*o = Objects[ARTIFACTID + 17];
break;
case ATHENA:
*o = Objects[ARTIFACTID + 16];
break;
case HECATE:
*o = Objects[ARTIFACTID + 15];
break;
case DRUID:
*o = Objects[ARTIFACTID + 18];
break;
case DESTINY:
*o = Objects[ARTIFACTID + 19];
break;
}
o->known = 2;
/* Random hack to convey bit that symbol is functional */
o->charge = 17;
morewait();
if(Player.patron == DRUID) {
print1("Your deity raises you to the post of Archdruid!");
}
else {
print1("You deity raises you to the post of High Priest!");
}
print2("You feel holy.");
strcpy(Priest[Player.patron], Player.name);
Priestlevel[Player.patron] = Player.level;
Player.rank[PRIESTHOOD] = HIGHPRIEST;
morewait();
learnclericalspells(Player.patron, HIGHPRIEST);
}
开发者ID:tcadigan,项目名称:omega_0.75,代码行数:53,代码来源:opriest.c
示例16: l_escalator
void l_escalator(void)
{
print1("You have found an extremely long stairway going straight up.");
print2("The stairs are grilled steel and the bannister is rubber.");
morewait();
print1("Take the stairway? [yn] ");
if (ynq1()=='y') {
print1("The stairs suddenly start moving with a grind of gears!");
print2("You are wafted to the surface....");
change_environment(E_COUNTRYSIDE);
}
}
开发者ID:anylonen,项目名称:omega,代码行数:12,代码来源:move.c
示例17: l_rubble
void l_rubble(void)
{
int screwup = random_range(100) - (Player.agi + Player.level);
print1("You climb over the unstable pile of rubble....");
if (screwup < 0) print2("No problem!");
else {
print2("You tumble and fall in a small avalanche of debris!");
print3("You're trapped in the pile!");
Player.status[IMMOBILE]+=2;
p_damage(screwup/5,UNSTOPPABLE,"rubble and debris");
morewait();
}
}
开发者ID:anylonen,项目名称:omega,代码行数:13,代码来源:move.c
示例18: sprint_decl1
void
sprint_decl1 (char *s, size_t *len, IDENT *i, BOOLEAN print_semicolon)
{
CTYPE *ctype = i->ctype;
#ifndef NDEBUG
assert_ctype_valid(ctype);
#endif
/* We don't want to print anything if i is a forward reference, since
a forward reference (although creating an entry in the symbol table)
is not a declaration. */
#ifndef NDEBUG
if (i->forward)
assertion_failed("tried to print forward reference %s", i->name);
if (ctype == NULL)
assertion_failed("identifier has null ctype");
#endif
/* Only print something if there is anything worth printing. */
if (!i->defaulted
|| i->sclass != UND
|| ctype->uclass != ERR
|| i->initializer != NULL) {
char *t;
/* Print sclass (ie storage class, eg register). */
t = sclass_string1(i->sclass);
if (strcmp(t, "") != 0) {
print1(s, len, t);
print2(s, len, " ", 1);
}
/* Print uclass (ie signed/unsigned). */
t = uclass_string(ctype->uclass);
if (strcmp(t, "") != 0) {
print1(s, len, t);
print2(s, len, " ", 1);
}
/* Print rest of declaration. */
sprint_decl2(s, len, i);
if (print_semicolon)
print2(s, len, ";", 1);
}
}
开发者ID:mpw,项目名称:p2,代码行数:49,代码来源:pb-io.c
示例19: gain_level
/* Increase in level at appropriate experience gain */
void gain_level(void)
{
int gained=FALSE;
int hp_gain; /* FIXED! 12/30/98 */
if (gamestatusp(SUPPRESS_PRINTING))
return;
while (expval(Player.level+1) <= Player.xp) {
if (!gained)
morewait();
gained = TRUE;
Player.level++;
print1("You have attained a new experience level!");
print2("You are now ");
nprint2(getarticle(levelname(Player.level)));
nprint2(levelname(Player.level));
hp_gain = random_range(Player.con)+1; /* start fix 12/30/98 */
if (Player.hp < Player.maxhp )
Player.hp += hp_gain*Player.hp/Player.maxhp;
else if (Player.hp < Player.maxhp + hp_gain)
Player.hp = Player.maxhp + hp_gain;
/* else leave current hp alone */
Player.maxhp += hp_gain;
Player.maxmana = calcmana();
/* If the character was given a bonus, let him keep it. Otherwise
* recharge him. */
Player.mana = max(Player.mana, Player.maxmana); /* end fix 12/30/98 */
morewait();
}
if (gained) clearmsg();
calc_melee();
}
开发者ID:anylonen,项目名称:omega,代码行数:33,代码来源:aux2.c
示例20: omegan_character_stats
void omegan_character_stats(void)
{
int share1,share2,i=0;
print1("To reroll hit ESCAPE; hit any other key to accept these stats.");
do {
i++;
#if REROLLS == -1
sprintf(Str1, "Generated character # %d", i );
#else
sprintf(Str1, "You have only %d chance%s to reroll... ", REROLLS - i,
(i == (REROLLS-1) ) ? "":"s");
#endif
print2(Str1);
Player.iq = Player.maxiq = 4 + random_range(5)+
(share1 = random_range(6)) + (share2 = random_range(6));
Player.pow = Player.maxpow = 4 + random_range(5) + share1 +share2;
Player.dex = Player.maxdex = 4 + random_range(5)+
(share1 = random_range(6)) + (share2 = random_range(6));
Player.agi = Player.maxagi = 4 + random_range(5) + share1 +share2;
Player.str = Player.maxstr = 4 + random_range(5)+
(share1 = random_range(6)) + (share2 = random_range(6));
Player.con = Player.maxcon = 4 + random_range(5) + share1 +share2;
Player.cash = random_range(100)+random_range(100)+
random_range(100)+random_range(100)+random_range(100);
Player.hp=Player.maxhp=Player.con;
Player.mana=Player.maxmana = calcmana();
calc_melee();
dataprint();
#if REROLLS == -1
} while (mgetc() == ESCAPE);
#else
}
开发者ID:cwc,项目名称:OmegaRPG,代码行数:32,代码来源:char.cpp
注:本文中的print2函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论