- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
for(;;)
{
try
{
game();
}
catch(game_end e)
{
if(e.reason == GAME_WIN)
{
printf("** Would you like to play again? (y-n) ");
if(get_y_n()) continue;
break;
}
else if(e.reason == GAME_LOSE)
{
printf("** Try again? (y-n) ");
if(get_y_n()) continue;
printf("** Are you coward? (y-n) ");
if(get_y_n()) break;
printf("** Try again? (y-n) ");
if(get_y_n()) continue;
break;
}
else if(e.reason == GAME_RESTART)
{
continue;
}
else
{
break;
}
}
}
GovnocoderJr 16.01.2010 18:48 # 0
std::vector<int> proper_rooms;
for(int i=MIN_ROOM; i<=MAX_ROOM; ++i)
{
if( ( _no_player && i == player.room_ex ) ||
( _no_wumpus && i == wumpus.room_ex ) ||
( _no_bats && rooms.ex(i).bats ) ||
( _no_pits && rooms.ex(i).pit ) ||
( _player_min_dist_2 && rooms.dist(i, player.room_ex) < 2) ||
( _player_min_dist_3 && rooms.dist(i, player.room_ex) < 3) )
continue;
proper_rooms.push_back(i);
}
return proper_rooms[rgen(proper_rooms.size())];
guest 16.01.2010 23:42 # 0
guest 17.01.2010 00:16 # 0
zitzy 17.01.2010 09:54 # 0
homakov 17.01.2010 18:30 # 0
guest 19.01.2010 01:08 # 0
guest 21.01.2010 11:26 # 0
Altravert 21.01.2010 11:44 # 0
guest 28.01.2010 01:49 # 0
Are you coward?
Try again?
guest 07.03.2010 00:53 # 0