Ad
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Damn mutable defaults are weird..

  • Custom User Avatar

    Sorry yeah i made that mistake. Fixed now. Thanks!

  • Custom User Avatar

    I don't know but pretty sure thats not the case. Just now checked that base is everywhere bigger than 0 in the fixed tests and in the random tests too.
    For you to check the random tests:

    int randint(int min, int max) {
        return rand() % (max + 1 - min) + min;
    };
    

    That is the function i create random integers with.
    Its used like this to create base b:

    int b = randint(1, 16);
    

    or for bigger numbers

    int b = randint(1, 5000);
    

    So b should'nt be 0. Please correct if you find a mistake.

  • Custom User Avatar

    Does it work in your console for a base > 36? I.e 50?

  • Custom User Avatar

    To be sure you understood correctly: one call of beep is equivalent to one -or . or ... It has to be able to differ in execution time each time its called based on the message in the buffer. The decoder will execute beep multiple times per message. The decoder will continue to call beepuntil one execution of beeptakes a very small (no) time to excecute. Then the times measured will be translated back into the message.

  • Custom User Avatar

    I worded it as

    The seed from which to test need not be the initial seed of the sequence passed to find_lfsr. However in our tests every given seed is guaranteed to be one of the elements or a future element of the given sequence. The behavior of the returned generator for a seed which can not be "reached" from the initial sequence will not be tested and can be arbitrary.

    I think this resolves the issue. If I made a mistake or have a recommendation how to improve this please let me know. I thought about removing the seed altogether and just have the function return a generator which always starts at the initial value of the given sequence, but I like it more like this. What is your opinion?

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    ill write more test cases. but i have loop cases ^^

  • Custom User Avatar
  • Custom User Avatar

    You can assume that the seed is part of the sequence since I generate it from a known LFSR. There will be no seeds outside that sequence. I will only test legit seeds. I first sample a random seed index (meaning after the inital seed of the sequence) and then generate the seed once with the same lsfr that generated the initial sequence. And predicting the future elements of the sequence is the whole point of this kata.

    Maybe we mean different seeds I am talking about the seed given to the generator not the initial seed of the sequence. If this resolves the issue let me know and ill resolve it. Also if you have a better wording for the description to make clear what I mean please let me know :)

  • Custom User Avatar

    Regarding the other issue with the test seeds being 0 very often: I change the index if a zero is detected to a random lower index in 50% of the cases.

  • Custom User Avatar
  • Loading more items...