当前位置: 首页>>代码示例>>C++>>正文


C++ print2函数代码示例

本文整理汇总了C++中print2函数的典型用法代码示例。如果您正苦于以下问题:C++ print2函数的具体用法?C++ print2怎么用?C++ print2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的print2函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。