Changeset 7a925a41


Ignore:
Timestamp:
Oct 1, 2023, 12:29:04 PM (7 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
16b5d11
Parents:
26be854
Message:

final hotpotato cleanup, removed two unneeded routines from explicit polling flavour

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/hotpotato.cfa

    r26be854 r7a925a41  
    6565} // vote
    6666
    67 static void terminate( Player & player ) {                              // resume umpire
    68         resume( player );
    69     assert( false );                                                    // no return
    70 } // terminate
    71 
    7267void init( Player & player, Player & lp, Player & rp ) with(player) { // supply partners
    7368        partner[LEFT] = &lp;
     
    7974        return player.id;
    8075} // getId
    81 
    82 void toss( Player & player ) {                                                  // tossed the potato
    83     resume( player );
    84 } // toss
    8576
    8677void main( Player & player ) with(player) {
     
    9990            size_t side = prng( prng, 2 );
    10091            sout | id | " -> " | nonl;
    101             toss( *partner[ side ] );                   // random toss left/right
     92            resume( *partner[ side ] );                 // random toss left/right
    10293        } // for
    10394        } catchResume( Terminate * v ) {
     
    122113        } // if
    123114        resumeAt( umpire, ExceptionInst( Terminate, &player ) );
    124         terminate( umpire );
     115        resume( umpire );                   // resume umpire to terminate this player
    125116        assert( false );                                        // no return
    126117    } // try
     
    198189                        &umpire = players[rposn];                                       // designate umpire and start game
    199190                        sout | "U " | nonl;
    200                         toss( *players[rposn] );
     191                        resume( *players[rposn] );
    201192                        delete( &umpire );
    202193                }
Note: See TracChangeset for help on using the changeset viewer.