Retired

Alien Logo (retired)

Description
Loading description...
Algorithms
Arrays
Data Types
Logic
  • Please sign in or sign up to leave a comment.
  • eptaceps Avatar

    Could someone help me to fix test cases?

    • B1ts Avatar

      Here's a few problems I see straight away:

      • You defined everything in your solution (including randomizers and stuff related to tests). You should put everything related to tests in the test cases tab.
      • You should wrap your assertions in describe -> it block, for example test cases (just like for regular tests)
      • You're calling 'alien', which isn't defined anywhere. Clearly you want to assert that user's function returns same result as your function. So you should copy your solution to test cases tab. Solvers can't see it, but if the function name is easy, they might be able to guess it, and call it from their solution space, so simple way is to obfuscate it by naming your solution alien3513545863112 or whatever (so they can't guess it), then just replace 'alien' with that name. (maybe there's some simple way so that they can't access it altogether, but I don't know, I'm a newb in c++)

      Let me know if you understood it or got any questions, good luck.

    • eptaceps Avatar

      Hi, thanks for helping :) I think that now most issues are fixed, altough i don't get the second point you listed. How should i wrap them? as you said, this is probably what blocks sample test (in fact to republish i had to include none)

  • Unnamed Avatar

    Sample tests:

    main.cpp:11:9: error: C++ requires a type specifier for all declarations
    Assert::That(alien_logo(2, 3), Equals(
            ^
    main.cpp:11:32: error: no matching function for call to 'Equals'
    Assert::That(alien_logo(2, 3), Equals(
                                   ^~~~~~
    
    • eptaceps Avatar

      hello, thanks for replying i think i haven't understood why it gaves those errors and how i should fix it would you help me?

    • Unnamed Avatar

      You should pass a vector instead of an initializer_list.

    • eptaceps Avatar

      ehm, in they way i changed now or returning the correct solution from another function like "alien(..);" (sorry for possibly noob questions)

  • Unnamed Avatar
    main.cpp:15:45: error: use of undeclared identifier 'alien'
        Assert::That(alien_logo(7, 7),   Equals(alien(7, 7)));
                                                ^
    ...
    main.cpp:25:29: error: use of undeclared identifier 'par'
        Assert::That(alien_logo(par.gen_N(), par.gen_skip()),  Equals(alien(par.get_N(), par.get_skip())));
                                ^