Ad
  • Custom User Avatar
    System.TypeInitializationException : The type initializer for 'PsychicGuesser' threw an exception.
      ----> System.FieldAccessException : Cannot set initonly static field 'random' after type 'GuessingGame' is initialized.
    

    This kata is broken in C# 10. Looking through the list of submitted solutions I found only 2 approaches that everybody used:

    1. This one (used by the kata author himself) which is not valid anymore
    2. And this one which still works but also relies on how game.Guess will be called even though the description doesn't provide any guarantees about this

    Either the description should be changed to make the second approach a legitimate solution, or this kata should be retired.