• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ print1函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了print1函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: l_sacrificestone

void l_sacrificestone(void)
{
  int sacrifice=1;
  int oldmaxhp = Player.maxhp;
  print1("You have come on a weathered basaltic block.");
  print2("On the top surface is an indentation in human shape.");
  morewait();
  print1("You see old rust colored stains in the grain of the stone.");
  print2("You sense something awakening. Touch the block? [yn] ");
  if (ynq2() == 'y') {
    print1("You sense great pain emanating from the ancient altar.");
    print2("Climb on to the block? [yn] ");
    if (ynq2() == 'y') {
      print1("You are stuck fast to the block!");
      print2("You feel your life-force being sucked away!");
      morewait();
      print1("Hit ESCAPE to try and get up at any moment, SPACE to remain.");
      do {
	switch(random_range(4)) {
	  case 0: print2("You feel weaker."); break;
	  case 1: print2("You feel your life fading."); break;
	  case 2: print2("Your energy is vanishing."); break;
	  case 3: print2("You are being drained."); break;
	  }
	Player.hp -= sacrifice;
	Player.maxhp -= sacrifice/2;
	sacrifice *= 2;
	dataprint();
	if ((Player.hp < 1) || (Player.maxhp < 1))
	  p_death("self-sacrifice");
      } while (stillonblock());
      print1("You manage to wrench yourself off the ancient altar!");
      print2("You leave some skin behind, though....");
      morewait();
      if ((oldmaxhp > 10) && (Player.maxhp < 3 * oldmaxhp/4)) {
	print1("A strange red glow arises from the altar.");
	print2("The glow surrounds you.... You sense gratitude.");
	Player.pow += sacrifice;
	Player.maxpow += sacrifice/10;
	dataprint();
      }
      else {
	print1("You a have a sense of rejection.");
	print2("A roil of fetid vapor smokes up from the altar.");
	gain_experience(sacrifice);
      }
    }
    else {
      print1("You sense an emotion of pique all around you.");
      print2("You retreat from the strange stone.");
    }
  }
  else {
    print1("You decide discretion to be the better part of valour.");
    print2("The stone seems to subside sleepily.");
  }
}
开发者ID:anylonen,项目名称:omega,代码行数:57,代码来源:move.c


示例2: getarg

int getarg() { int arglen1; int i; char *c; arglen1=*arglen; 
  if (arglen1) {i=arglen1+0x81; c=i; *c=0; strcpy1(namein, argv); 
    strcpy1(namelst, namein); i=strlen1(namelst); i--; c=&namelst+i; *c='S'; }
  else {strcpy1(namein, "F.C"); strcpy1(namelst, "F.S"); }  
  fdin=open2 (namein);
  if(DOS_ERR !=0){print1("Datei fehlt: "); print1(namein); exit1(1); }
  fdout=creat1(namelst);
  if(DOS_ERR !=0){print1("Datei nicht erzeugbar: ");print1(namelst);exit1(2);}
  prs("\n;Arglen: "); prnum(arglen1); if(arglen1){prs(", Argv: "); prs(argv);}
}  
开发者ID:ALANGUAGE,项目名称:A2011,代码行数:10,代码来源:A88.C


示例3: print1

void print1(struct node *p, int level) {
  int i;
  if (p == NULL)
    return;
  for (i = 0; i < level; i++)
    printf("*");
  printf("key:%d, value:%d\n", p->key, p->value);
  print1(p->left, level + 1);
  print1(p->right, level + 1);
}
开发者ID:hoshitocat,项目名称:tukuba_c_language,代码行数:10,代码来源:info21_8.c


示例4: updateTopScore

void updateTopScore() {
  char buf[7];

  // Выводим счет игрока
  i2s(buf, hiScores[0].score);
  SET_COLOR(COLOR_GREEN);
  print1(PIXELCOORDS(3,7),1,5,buf);

  // Выводим имя игрока
  print1(PRINTARGS(5,19),7|0x80,hiScores[0].name);
}
开发者ID:VWarlock,项目名称:OldLines,代码行数:11,代码来源:spec_interface.c


示例5: print1

void Binary::print1(node*temp)
{
	if(temp)
	{
		print1(temp->left);

		cout<<temp->data<<" ";

		print1(temp->right);
	}
}
开发者ID:Dirker27,项目名称:DataStructures,代码行数:11,代码来源:BINTREE_.CPP


示例6: 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


示例7: 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


示例8: main

int main(int argc, char *argv[])
{
	int res;

	print1();

	res = setvbuf(stdout, NULL, _IOLBF, 0);	// line buffer
	assert(res == 0);

	print1();
	
    return 0;
}
开发者ID:cxsjabc,项目名称:basic,代码行数:13,代码来源:setvbuf1_lb.c


示例9: configloopback

void
configloopback(void)
{
	int fd;

	if((fd = open("/net/ipifc/clone", ORDWR)) < 0){
		bind("#I", "/net", MAFTER);
		if((fd = open("/net/ipifc/clone", ORDWR)) < 0)
			fatal("open /net/ipifc/clone for loopback");
	}
	if(print1(fd, "bind loopback /dev/null") < 0
	|| print1(fd, "add 127.0.0.1 255.255.255.255") < 0)
		fatal("write /net/ipifc/clone for loopback");
}
开发者ID:CoryXie,项目名称:NxM,代码行数:14,代码来源:local.c


示例10: 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


示例11: print1

void print1(struct insertNodes *processroot)
{
	if(strcmp(root->storepid,processroot->processtree->storeppid)==0)
	{
	printf("Equals : %s, %s, %s\n",processroot->storecmd,processroot->storepid,processroot->storeppid);
	print1(processroot->processtree);
	}
	if(strcmp(processroot->storepid,processroot->processtree->storeppid)<0)
        {
        printf("Not Equals : %s, %s, %s\n",processroot->storecmd,processroot->storepid,processroot->storeppid);
        
        }
	return;
	print1(root->stree);
}
开发者ID:dfadiya,项目名称:Operating-Systems,代码行数:15,代码来源:ProcessTree.c


示例12: main

int main()
{
	print1();
	print2();

	return 0;
}
开发者ID:duanzw88,项目名称:c_program,代码行数:7,代码来源:main.c


示例13: peruse

/* read a scroll, book, tome, etc. */
void peruse()
{
  int index;
  struct object *obj;

  clearmsg();

  if (Player.status[BLINDED] > 0)
    print3("You're blind -- you can't read!!!");
  else if (Player.status[AFRAID] > 0)
    print3("You are too afraid to stop to read a scroll!");
  else {
    print1("Read -- ");
    index = getitem(SCROLL);
    if (index == ABORT)
      setgamestatus(SKIP_MONSTERS);
    else {
      obj = Player.possessions[index];
      if (obj->objchar != SCROLL) {
	print3("There's nothing written on ");
	nprint3(itemid(obj));
      }
      else {
	nprint1("You carefully unfurl the scroll....");
	morewait();
	item_use(obj);
	dispose_lost_objects(1,obj);
      }
    }
  }
}
开发者ID:DavidKinder,项目名称:Omega,代码行数:32,代码来源:command2.c


示例14: main

int main(int argc, char **argv)
{
	print1();
	print2();

	return 0;
}
开发者ID:dark77777blue,项目名称:src,代码行数:7,代码来源:main.c


示例15: func_1

static uint32_t func_1(void)
{
  uint32_t l_2 = 0UL;
  int32_t l_4[7][5] = {{0x5872D9EEL, 0x9ED9BA07L, 0x9ED9BA07L, -1L, 0x9ED9BA07L}, {0x2285FAAFL, 0x9ED9BA07L, -1L, 6L, 0x5872D9EEL}, {-1L, 0x2285FAAFL, 0x5872D9EEL, 6L, 6L}, {6L, -1L, 0x9ED9BA07L, -1L, -3L}, {6L, -1L, -1L, 0x2285FAAFL, 0x5872D9EEL}, {-1L, -1L, -1L, -3L, 0x2285FAAFL}, {0x2285FAAFL, -1L, 0x9ED9BA07L, 0x2285FAAFL, 0x2285FAAFL}};
  int i;
  int j;
  l_4[2][3] = print0((l_2 < g_3) & g_3, 43);
  for (g_3 = print1(-27, 44); g_3 <= 17; g_3 += print2(3, 44))
  {
    uint32_t l_23 = 0xE3D1AA12L;
    if (((int8_t) func_9(g_3, g_3, g_3)) << ((int8_t) 0))
    {
      g_30[2] = print3(((int16_t) (func_19(6L || 0UL, l_23, g_14[4][0]) && 0x5CL)) << ((int16_t) l_23), 49);
    }
    else
    {
      int16_t l_37 = 1L;
      l_4[2][3] = print4(func_31(((((uint16_t) ((l_4[0][4] == g_30[2]) <= l_37)) - ((uint16_t) l_23)) | g_29[0][7]) <= g_3, l_2, l_4[2][3]), 54);
    }

    for (g_13 = print5(2, 56); g_13 >= 0; g_13 -= print6(1, 56))
    {
      int32_t l_46 = -1L;
      int i;
      g_43 = print7(g_30[g_13] ^ g_30[g_13], 60);
      l_46 ^= print8((((int16_t) (((g_30[g_13], g_13)) <= 1UL)) - ((int16_t) g_3)) ^ g_29[1][3], 61);
    }

  }

  return l_4[2][3];
}
开发者ID:AVR-GCC,项目名称:ArduinoAnalyzer,代码行数:32,代码来源:wp20151011-01:28:56_avrtest.c


示例16: eat

void eat()
{
  int index;
  struct object *obj;

  clearmsg();

  print1("Eat --");
  index = getitem(FOOD);
  if (index == ABORT)
    setgamestatus(SKIP_MONSTERS);
  else {
    obj = Player.possessions[index];
    if ((obj->objchar != FOOD)&&(obj->objchar != CORPSE)) {
      print3("You can't eat ");
      nprint3(itemid(obj));
    }
    else {
      if (obj->usef == I_FOOD) Player.food = max(0,Player.food+obj->aux);
      item_use(obj);
      dispose_lost_objects(1,obj);
      if (Current_Dungeon == E_COUNTRYSIDE) {
	Time += 100;
	hourly_check();
      }
    }
  }
  foodcheck();
}
开发者ID:DavidKinder,项目名称:Omega,代码行数:29,代码来源:command2.c


示例17: main

int
main()
{
    print1(1, 2, 3);
    print2(1, 2, 3);
    auto pack = make_argpack<C>(1, 2);
    std::cout << type_name<decltype(pack)>() << std::endl;
    auto arg = pack.get<G, float>();
    std::cout << type_name<decltype(arg)>() << std::endl;
    pack.call<G, float>(print3);
    auto f = [] {};
    std::cout << type_name<decltype(f)>() << std::endl;
    auto &_pack = pack;
    std::cout << type_name<decltype(_pack)>() << std::endl;
    std::cout << type_name<decltype(std::move(_pack))>() << std::endl;

    std::cout << type_name<decltype(make_argpack<C>())>() << std::endl;
    std::cout << type_name<decltype(make_argpack<C>(std::declval<int>(),
                                                    std::declval<int&>(),
                                                    std::declval<int&&>()))>()
              << std::endl;

    int i = 0;
    int &ia = i;
    int &&iaa = std::move(i);
    make_argpack<C>(std::move(iaa), ia, i, ([] {return 0;})());
}
开发者ID:yuyichao,项目名称:explore,代码行数:27,代码来源:main.cpp


示例18: l_whirlwind

void l_whirlwind(void)
{
  print1("Buffeting winds swirl you up!");
  p_damage(random_range(difficulty()*10),NORMAL_DAMAGE,"a magic whirlwind");
  if (random_range(2)) {
    print2("You are jolted by lightning!");
    p_damage(random_range(difficulty()*10),ELECTRICITY,"a magic whirlwind");
  }
  morewait();
  if (random_range(2)) {
    print1("The whirlwind carries you off....");
    if (random_range(20)==17)
      print2("'I don't think we're in Kansas anymore, toto.'");
    p_teleport(0);
  }
}
开发者ID:anylonen,项目名称:omega,代码行数:16,代码来源:move.c


示例19: drawScore

void drawScore(uint score, char* scoreText) {
  uchar n;
  register uchar* s;  

  SET_COLOR(COLOR_GREEN);
  print1(PIXELCOORDS(40,7),2,5,scoreText);
  
  if(score < hiScores[0].score) {
    n = (score / (hiScores[0].score / 13));
    if(n>13) n=13;
  } else {
    n = 14;
  }

  if(playerSpriteTop != n) {
    playerSpriteTop = n;
    for(s=PIXELCOORDS(40, 167); n; --n, s-=4)
      bitBlt(s, imgPlayerD, 5*256+4);  
    bitBlt(s-46, imgPlayer, 5*256+50);                                         
    if(playerSpriteTop == 14) {
      bitBlt(s-50+0x200, imgPlayerWin, 3*256+16);
      bitBlt(PIXELCOORDS(3, 53), imgKingLose, 6*256+62);                                         
    }
  }
}
开发者ID:VWarlock,项目名称:OldLines,代码行数:25,代码来源:spec_interface.c


示例20: l_enter_circle

void l_enter_circle(void)
{
  print1("You see a translucent stairway before you, leading down.");
  print2("Take it? [yn] ");
  if (ynq()=='y')
    change_environment(E_CIRCLE);
}
开发者ID:anylonen,项目名称:omega,代码行数:7,代码来源:move.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ print2函数代码示例发布时间:2022-05-30
下一篇:
C++ print函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap