Skip to content
Snippets Groups Projects
  1. Apr 28, 2016
  2. Apr 27, 2016
  3. Apr 25, 2016
    • ulif's avatar
      Provide a logger, API-wise. · 70f91b65
      ulif authored
      Add a common place where components can write messages to. Any
      userinterface can decide, what messages should be visible
      (depending on their severity).
      70f91b65
  4. Apr 24, 2016
  5. Apr 21, 2016
  6. Apr 20, 2016
  7. Apr 19, 2016
    • dwcoder's avatar
      Put calculations in right place · a08516d7
      dwcoder authored
      Move the calculations out of the `pre_check()` function.
      Also do smarter checks:
        - If len(sequence) == 1, we don't need any rolls. In this case, just
          return sequence[0]
        - If len(sequence) is a factor of dice_sides, we only need one roll
          along with the modulo operator.
        - For everything else, just require one extra roll, bringing it to a
          total of 2 rolls. This should remove a little bit of the edge bias
          introduced by the modulo
      Run the `pre_check()` function after the calculations have been done.
      
      For the unit tests:
        - remove the function `test_choice_len_too_short()`;
          we no longer have to raise an exception when the sequence length is
          too short.
        - Write new tests for the cases where `dice_sides = 6` and `len(sequence)`:
           - 1
           - 2,3
           - 4,5
      a08516d7
  8. Apr 17, 2016
  9. Apr 16, 2016
  10. Apr 15, 2016
  11. Apr 14, 2016
  12. Apr 13, 2016
Loading