1. exploreAllPossibilities( ) {
  2. QueueClass commandQueue = new QueueClass( );
  3. commandQueue.initializeQueue( );
  4.  
  5. while( !roomStack.isEmpty( ) ) {
  6. int iterator = 0;
  7. IntElement converter = new IntElement( );
  8.  
  9. while( IntElement( roomCommands[roomStack.top( )][iterator] != 0 ) {
  10. converter.setNum( ( roomCommands[roomStack.top( )][iterator] ) );
  11. commandQueue.addQueue( converter );
  12. iterator++;
  13. }
  14. roomStack.pop( );
  15. iterator = 0;
  16.  
  17. while( !commandQueue.isEmpty( ) ) {
  18. takeAction( commandQueue.front( ) );
  19. commandQueue.deleteQueue( );
  20. }
  21.  
  22. commandQueue.initializeQueue( );
  23. }
  24. }