>>106478708
idk why everyone hates on this code it's actually very readable. I think the idea that these should all be in some array or a dictionary is probably too high level for the task complexity. All it does is move data out of control flow, doesn't actually make reasoning about the code any easier
And these are gameover states you know by design that you aren't going to add any further nesting or complicated jumps/functions
In c this would just be a for loop over an array running some opaque function, probably be the same amount of code after error handling
int found = 0;for ( int i = 0; i < sizeof ( reactions ) / sizeof ( reactions [ 0 ] ); i++ ){
if ( strcmp ( Witnessed, reactions [ i ].witnessed ) == 0 ) {
Updatelabel ( reactions [ i ].label, 1, 6.0f ); GameOverCause = reactions [ i ].cause; found = 1; break; }}
if ( !found ){
printf ( "No reaction.\n" );}
else{
printf ( "GameOverCause = %s\n", GameOverCause );}}