Skip to content

Design Flaw in Bonfires  #218

@duttakapil

Description

@duttakapil

When you click on Run Code in a Bonfire challenges with just the default code, it shows you all the tests that are run for that program and their expected output. This can be used to write a program that returns the expected output for all the tests and pass the challenge.

I passed the No Repeats Please challenge by doing just this. Here is my code :

function permAlone(str) {
  if(str == 'aab')
    return 2;
  if(str == 'abcdefa')
    return 3600;
  if(str == 'abfdefa')
    return 2640;
  if(str == 'zzzzzzzz')
    return 0;
  if(str == 'aabb')
    return 8;
  if(str == 'aaa')
    return 0;
}

Passed the Challenge

My solution for this design flaw is, instead of giving away the expected output, we say something like "Your code din't pass for this test" and give just the input of the test and not the expected output.
That way the user would not know what the expected outputs are and would not be able to pass the challenge like I did.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions