Пример #1
0
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.");
  }
}
Пример #2
0
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);}
}  
Пример #3
0
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);
}
Пример #4
0
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);
}
Пример #5
0
void Binary::print1(node*temp)
{
	if(temp)
	{
		print1(temp->left);

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

		print1(temp->right);
	}
}
Пример #6
0
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);
  }
}
Пример #7
0
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);
}
Пример #8
0
int main(int argc, char *argv[])
{
	int res;

	print1();

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

	print1();
	
    return 0;
}
Пример #9
0
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");
}
Пример #10
0
Файл: pb-io.c Проект: mpw/p2
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);
  }
}
Пример #11
0
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);
}
Пример #12
0
int main()
{
	print1();
	print2();

	return 0;
}
Пример #13
0
/* 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);
      }
    }
  }
}
Пример #14
0
int main(int argc, char **argv)
{
	print1();
	print2();

	return 0;
}
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];
}
Пример #16
0
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();
}
Пример #17
0
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;})());
}
Пример #18
0
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);
  }
}
Пример #19
0
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);                                         
    }
  }
}
Пример #20
0
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);
}
Пример #21
0
int main()
{
	char s[10];
	struct node *t;
	int m;
	int a;

	scanf("%d", &m);
	t=(struct node*)malloc(sizeof(struct node)*m);

	int count=0;
	for(int i=0; i<m; i++){
		scanf("%s", &s);
		if(s[0]=='i'){ scanf("%d", &a); insert(t, count, a); count++; }
		if(s[0]=='p'){
			if(count>0) print1(t, 0);
			printf("\n");
			if(count>0) print2(t, 0);
			printf("\n");
		}
	}
	
	return 0;

}
Пример #22
0
int main()
{
    printf("ile liczb?: ");
    int n;
    korzen t1, *tree;
    tree=malloc(sizeof(korzen));
    *tree=NULL;
    scanf("%d", &n);
    for(int i=0; i<n;i++)
    {
        int nowy;
        scanf("%d", &nowy);
        wstaw(tree, nowy);
    }
    print1(*tree);
    printf("\n");
    printf("co znalezc?:");
    int szuk;
    scanf("%d", &szuk);
    szuk=find(*tree,szuk);
    if(szuk==-1)
        printf("not found\n");
    else
        printf("wystepuje %d raz(y)", szuk);
    return 0;
}
Пример #23
0
void CView::println(CViewState& vs)
{
uint64_t yOffset = getLineOffset(vs);
std::string line;
	print1(yOffset,line);
	s.printfxy(0,vs.y+HEADER_LINES,"%s",line.c_str());
}
Пример #24
0
/* 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();
}
Пример #25
0
void i_perm_breathing(pob o)
{
  if (o->known < 1)  o->known = 1;
  if (o->blessing > -1)
    Objects[o->id].known = 1;

  if (o->blessing > -1) {
    if (o->used) {
      mprint("Your breath is energized!");
      Player.status[BREATHING] += 1500;
    }
    else  {
      Player.status[BREATHING] -= 1500;
      if (Player.status[BREATHING] < 1) {
	mprint("Your breathing is back to normal.");
	Player.status[BREATHING] = 0;
      }
    }
  }
  else if (o->used) {
    Player.status[BREATHING] = 0;
    p_drown();
    print1("Water pours from the broken suit.");
  }
}
Пример #26
0
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
    }
Пример #27
0
void print1(int x){
	if(x==-1)return;
	if(exam[x]==1)putchar('3');
	if(exam[x]==2)putchar('4');
	if(exam[x]==3)putchar('1');
	if(exam[x]==4)putchar('2');
	print1(back[x]);
}
Пример #28
0
int main(int argc, char ** argv)
{
    if (argc != 2) {
        printf("Usage: ./a.out 132\n");
        return 0;
    }
    print1(atoi(argv[1]));
}
Пример #29
0
void main()
{
	int x,y,z,i,j;
	char r;
	toe s;
	clrscr();
	print1();
	print(0,0,' ');
	cout<<"enter the choice x/o:";
	cin>>r;
	if(r=='x')
		x=1;
	else if (r=='o')
		x=2;
	goto b;
	a:
	if(x==1)
	{
		x=2;
		r='o';
	}
	else if(x==2)
	{
		x=1;
		r='x';
	}
	r:
	b:
	if(s.checka())
	{
		cout<<"enter the postion:\n" ;
		cin>>i>>j;
		clrscr();
		print1();
		print(i,j,r);
		if(s.a[i][j]!=0)
		{
			cout<<"value already exists\ny";
			goto r;
		}
		y=s.check(i,j,x);
		if(y==1)
			cout<<"game won by "<<r;
		else
			goto a;
	}
Пример #30
0
void first_task_code (){
	
	print1();

	SHUTDOWN();
	Exit();
	kprintf ("Unexpected return from Exit() at first_task_code\n\r");
}