The forum is deprecated and will become read-only.
Join our Discord or use GitHub Discussions.

Cheat Detection

As the site grows users who attempt to cheat the system will be inevitable. So far the community has been incredibly honorable about being honest when they do.

"Cheating" the solution to a kata can sometimes bring a lot of value to others. Creative, out-of-the-box thinking is something that is encouraged on Codewars, and developers can often learn a lot from solutions that bend the rules a bit. However some "cheat" solutions are not creative and offer no value to the community.

What are your thoughts on how Codewars should handle these cases? How do you think kata authors should protect their challenges from being gamed too easily? Should Codewars punish cheaters by suspending their accounts or deducting honor?

Please share your thoughts.

Discuss:

  • Please sign in or sign up to leave a comment.
  • rankinjo Avatar

    I copy and pasted a solution for https://www.codewars.com/kata/545cdb4f61778e52810003a2/train/python from a website and hit submit to see if it'd pass all the randomized tests. I didn't hit attempt button, instead I tried to find codewars policy and ended up here. But it appears hitting submit already gave me 8 honor for it, woops.

  • sarp__arslan Avatar

    Please remove my solution https://www.codewars.com/kata/599385ae6ca73b71b8000038 for "Ant Bridge". The solution is the same as ArslanEge which is my twin. After hours of work he wanted to joke me but He did not know that if the solution passes all the cases, It will be submited without pressing submit button. So this solution does not belong to me please remove it.

  • gbc79 Avatar

    Hi. Can you please remove my solution for kata "ASCII Games: Warning: Ice!"

    https://www.codewars.com/kata/58f4cc4e43251b1be6000082/cpp

  • rsschool_412e49862279a6be Avatar

    Hello, can you please delete my solution for Kata "7 kyu Count strings in objects". ( https://www.codewars.com/kata/565b3542af398bfb50000003/train/javascript/62bb876c04c6eda4c5834f1b ). I pasted someone else's code to compare and analyze with my solution and accidentally clicked submit. Thank you.

  • Wsko-12 Avatar

    Hello, can you please delete my solution for Kata "3 kyu How many are smaller than me II?" (https://www.codewars.com/kata/56a1c63f3bc6827e13000006); Because it's not my solution, I just wanted to check how fast is it.

  • Albert_codez Avatar

    hello mod,could i please have this kata removed from solved? i pasted something and accidentally clicked submit https://www.codewars.com/kata/526d84b98f428f14a60008da

  • Longstxck Avatar

    Hi mod, could I please have this kata removed from solved / be able to receive honor from it again?

    While trying to figure out : https://www.codewars.com/kata/52a78825cdfc2cfc87000005

    I copied and pasted something from another site to see if it worked. Accidently submitted it. Got the honor but it has since been removed. Am I Able to try it again and recieve honor from it?

  • tarnovsky Avatar

    Hi, could I get this kata removed form my solutions? https://www.codewars.com/kata/5592e3bd57b64d00f3000047/ I was trying to figure out how to remove it from my unfinished list and used soemone elses solution to see if I could delete it after solving.

  • Joec05 Avatar

    am a bit curious. have i been reported yet?

  • dariuszewski Avatar

    i hard coded 3 tests in Cargo-Bot Interpreter - pretty sure it's cheating but i did it just for testing, then, when editing forgot to remove it

  • mkaralar Avatar

    I think I've been punished again, I'm copying after coding in Intellij, it seems like I'll be dealing with this problem all the time...

  • mkaralar Avatar

    I do the exercises on Intellij and then copy and paste here, it's nicer and more enjoyable to code there, is that why I'm cheating? give me my points. How will my suspension be cancelled?

  • user4702135 Avatar

    Since I started using CW I've always wrote my code in pycharm then copy paste it here. I never had any issue with that, but can it be intepreted as cheating (even though it's not)? and how can you determine if someone is cheating or not?

  • toorg Avatar

    it should not be easy for on to cheat, randomize the test values so that it will be different everytime, hard coding tst results wont be possible then

  • toorg Avatar

    account suspension ....., that might be too severe

  • farhanaditya Avatar

    Hello mod, I was playing around with this Kata and it turned out that a hardcoded solution with obfuscation tool can bypass it. I submitted it but regretted it immediately. Can you remove the solution? Thanks!

  • Ghostmech Avatar

    I think it should scale according to the severity, up to suspending an account after warning.

  • Arturas1989 Avatar

    Hello,dear mods!

    Can you remove this kata from my solved: https://www.codewars.com/kata/59d582cafbdd0b7ef90000a0 I solved it accidently by putting nonsence code and found a bug. Don't want a cheating kata in my solved. Thank you.

  • user2289487 Avatar

    Hello, dear mods! Remove please this kata from my solved: https://www.codewars.com/kata/53d40c1e2f13e331fc000c26

    I just write a fun cheating code and passed all the tests, but I decided to go to the Discuss tab and Codewars sent the code as a solution instead of me, I'm an honest person and I don't want it to be in solved katas, thanks

  • er  Avatar

    Hello any mods here? Could I get this kata removed from my solved? https://www.codewars.com/kata/52ea928a1ef5cfec800003ee

    I copy pasted a piece of code from another site. I just wanted to see if it would work. Pressed the test button then the back. It turns out it submits that solution automatically.

    I don't like the feeling that my honor increased because I cheated. As I have worked hard for the rest of them. Could I get it revoked? p.s. no ban please :3

  • Bryt0n_l33t Avatar

    Hello, I am currently developing a kata for CW however I would like to remove the use of importing specific module all this in ruby do you have any solutions?

  • piepiepie45 Avatar

    I don't understand why people would cheat in Codewars.

    Codewars is a site that allows you to learn to program better by giving you challenges, and some friendly competition (the leveling system). Mistakes are the foundations to learning programming so it's better to learn from your mistakes than copy other peoples responses and not learn anything.

    Also Codewars isn't college. If you fail a Kata you have nothing to lose. In fact you gain more exeperience by learning from your mistakes.

    So please, don't cheat in Codewars :)

  • Awesome A.D. Avatar

    If I've encountered users copy/pasting my solution, should I do anything about it? While I don't regard CW as a competition and frankly don't care too much about how other people use it, there's one solution I am particularly proud of that has been grouped together with two random people with identical submissions, and there's another solution that is identical to mine with the comments stripped out.

    Original: https://www.codewars.com/kata/reviews/600c3855fe76f50001becef9/groups/601ac711f5baac0001a2cb1f Copy: https://www.codewars.com/kata/reviews/600c3855fe76f50001becef9/groups/60235253265b9c0001165294

    A part of me wants these users "punished" out of principle, but then again, I wonder, should I even care?

  • Renaud808 Avatar

    Hi CW team ! Sometimes, when my solution passes almost all the tests except a handful, I find useful to access failing tests data in order to understand where the problem lies. So I insert a "print(inputdata)" in the code to get a better understanding of what is fed to the function and why the code fails. Is it considered cheating ?

  • larsrotgers Avatar

    How can I see if my solution is removed for this reason? I just spend an entire day to write a Sudoku solver which solved most of the problems, and now all my progress is removed? What!?

  • ben10101010 Avatar

    i got my ranks on my other acount taken away for "cheating" but i was looking at a few katas then writing code in notepad++ then i copied and pasted from there and they did not belive me! and they did it again this time! thats very rude

  • bokunodev Avatar

    lets forget about "cheating" and focus on the bigger problem, which lots of kata has unclear istructions.

  • pawanpawar Avatar

    Copy and Paste should not be consider as cheating, I used to write my all programs in my webstrome editor, and then paste it on codewar's editor, I think if solutions are not different then the others might be consider as a cheating except few problems like print "Hello Wolrd" etc.

  • InesBorges Avatar

    That's all very pretty but my keyboard doesn't have less than and greater than signs. The only way I could write a less than sign character was by pasting the character into the code editor. Now I can't do my training, but I think is well done that we can't paste anything into code editors.

  • ramkh Avatar

    just had a solution "submit" and appear on my completed katas despite me not clicking submit button and returning to homepage. In "bagels" Kata saw a solution that used ... and wanted to see if that was a result of Bagels not using some kind of safeguard against this. Tried it in an attempt for a kata i have not legitimately solved (stupid of me) and despite returning to homepage without clicking the "submit" button it appears to have submitted. Can an Admin please remove this from my profile if possible. Not sure if this is the correct place to post please let me know if I can contact support somewhere else.

  • bluiisdave Avatar

    i dont know if this is the right place to ask but : hi, im wondering about the points system, i finished a kata ,kyu 5 and got some points, i think befor solving it i had 2163 or 2153 and then after i solved it i had 2171 but then it got down to 2165, does anyone know if it is a bug or what is it? also some times when i solve some katas lets say kyu 7, i get 2 points and sometimes its 3, this is how its suppose to be? is it a bug? thanks for any respond!

  • ShehabMuhammad Avatar

    If I basically copied and pasted a number of advanced katas, Is it possible to reduct their points and remove them from my profile? Or the Account has to be deleted or I get banned ? What's are the measures that should be taken?

  • zsolt-szilagyi Avatar

    I'd consider a solution a cheat if:

    errorneous testing

    The solution exploits the fact that not all written requirements are enforced by the unit tests. Example: You are to return 0,75 as the fraction 3/4, and instead return (3/4)*1000 / 1000. Error: Test did not enforce reduced and integer return. Reason why this is a cheat: While passing the test, it doesn't pass the Kata.

    Hardcoding beyond reason

    You know that there are only so many valid inputs, and you hardcode all possible return values. Example: The task requires you to do some searching on the first 1000 primes, and instead of generating them, you copy&paste them. Error: Test did not / cannot enforce sane memory limitations. Reason why this is a cheat: The solution exploits the fact that codewars wcannot execute scripts taking minutes to run, so sometimes the scope of input must be limited. This shall not be used to circumvent major parts of the workload

    I would not consider it a cheat if:

    copy&paste

    Copy & paste of minor helper functions from the web e.g. stack overflow. This is a gray area and "minor helper function" isn't an exact definition. But if I need to split a string into arrays while working ona Kyu2-Kata, I have no hard feelings about just googling that custom function instead of writing it from scratch.

    usage of buildt-in functions

    Sometimes your language offers you a funciton to solve a "hard" Kata in mere seconds. Not a cheat: In your specific language, that Kata wasn't hard after all.

  • okgnea Avatar

    I have nothing but respect for kata authors. To me coding is about finding a way to over come a challenge. What you call "cheating", in coding, I call creative. The way a "cheater" reaches a solution might not be optimal, but they did reach it. Even if it dose not measure or require the skills the kata authors intended. so long as the behavior dose not produce a malicious outcome, there should not be any penalty. Even in the case of blatant plagiarism, the cheater is only cheating themselves. Ultimately, The "cheater" over came the challenge, the kata authors can look at this as a challenge they too can over come.

  • UniqueLoginSucks Avatar

    Hello, please, can you provide info if in future, you can/are going to penalize accounts with cheat solutions in any way, or can you deny that you are going to do so in future for accounts with cheat solutions created before change of rules? I believe its importnat information to know if are in such situation (have a cheat solution) to know if we should create new account or use other wesite (other website as creating new account might lead to being labelled as cheater because you log in from same IP address, have same account info or something). Thanks

  • Baymurat Avatar

    Hello. I have a question. If you click "Attempt" and "Test" buttons consistently and quickly then "Submit" button becomes available, despite failed tests. In Test section you must have one positive assertion (assertEquals(true, true)). Is it bug, cheat or feature?

    Thanks

  • GDWR Avatar

    What cases are considered cheating? I have just spent so time creating a solution for https://www.codewars.com/kata/5235c913397cbf2508000048 within my IDE and once copy pasted into the web ui I have a cheating error. I may have missed a rule and this is considered cheating but if somebody could inform me on how to avoid or not cheat, that would be very helpful. Due to the solution working but with the cheating error I can provide it if requested.

    Thanks, GDWR

    Screenshot of error: https://prnt.sc/tsaly1

  • Mert21433 Avatar

    I accidentally cheated on a kata by writing a = 100 in one specific test case while I was messing with the problem. I am adding the link. How can I revert my solution?

    https://www.codewars.com/kata/reviews/5b75339f392571178f000ee8/groups/5f1c10db79aada0001672091

  • ophionea Avatar

    I tend to write out the code in a tet editor and paste it into Codewars, I don't seem to get credit for this, even though it is not cheating.

  • Entengummitiger Avatar

    I cheated on a certain kata. I was stumped as to how to solve it, so I tried to coax the system for some information about what test case was killing my solution. In the process I found a pattern in the test cases, which I abused to write a bogus function that would satisfy the test cases but not solve the problem. Here it is: https://www.codewars.com/kata/54d81488b981293527000c8f/solutions/python/me/best_practice What should I do now?

  • COder_ Avatar

    What if the person having two accounts in CW and he copy answers from one account and paste it to another!!

  • KSahithyan Avatar

    I don't know what to do with Cheaters. But CodeWars should not allow this kind of answers. https://www.codewars.com/kata/reviews/5324945e2ece5e1f32000373/groups/55a92b9f90769d35d10000e0

  • makentai Avatar

    It's impossible to be 100% sure whether a person has been cheating or not. Let's try to build an honest community where everyone can expect honesty and no scam from other community members. There will always be those who try to cheat, no need to fight the windmills.

  • uttumuttu Avatar

    I wonder if the existing solutions grouping algorithms could be repurposed for cheat detection. After finishing a kata, I often find that the top solution is part of a group. Now I don't know how clever the solutions grouping algorithm is, and certainly in simple katas people will inevitably come up with near-identical solutions. But in complex katas the likelihood of two people coming up with such identical solutions should be astronomically small, not to even mention larger groupings.

    The far more likely explanation is that people copy-paste existing solutions; either that, or a complete misestimation on my part about the workings of solutions grouping. In the former case, it would be trivial to send an automated alert to a moderator or the kata's sensei, who could then decide whether the similarities were coincidental. (For simpler katas such alert system could be disabled, as duplicates will arise naturally.)

  • IdenR Avatar

    I would find it impossible to solve the math algorithm based kata without googling the algorithm. This can't be cheating can it?

  • FlorinM Avatar

    I have two questions.

    1. I work in this way: on my system I write the code until I think it is ready to test it. So then I copy the code here on site. If it do not pass, I modyfy the code in my system and repeat the process. Is this cheat? Just because some script detects a copy-paste? I need to know that.You can see that my solutions are unique.
    2. Sometimes I wanted to see the input from test cases. Using console.log () in my solution (or var_dump, etc). Is this allowed? Thank you!
  • aambrioso1 Avatar

    I would like to post some of my more interesting or useful solutions to Kata in a repository on GitHub. I would change the function names to make it more difficult to search for them. Is that acceptable?

  • Reiterpallasch Avatar
  • expyth Avatar

    If I forget a method [ie reverse()] to manipulate a list, and I look up that method to solve a kata. Would this be considered cheating?

  • MasterSuthy Avatar

    vac ban?

  • tmijieux Avatar

    I think there should be a way for users to mark some of their own solution as "cheating solutions" and to not get any honor from these solutions(or a way to remove your own solutions). This would allow users that actually like to find way to cheat (like me) to know about their "true" honor rank. (By "cheating" I mean finding ways to pass katas without solving the actual problem, I'm not speaking of copy/pasting here)

  • shiningmatcha Avatar

    In Python, some users may use import to bypass the requirement that no modules can be imported. Please fix this.

  • DunetsNM Avatar

    There's a simple way to cheat in at least one popular kata series (I won't name it to avoid encouraging) where the only difference is the size of the input. Simpler variant is relatively easy to bruteforce and hence unlock other people's solution, some of which can solve hardest kata in the series.

    Not sure what to suggest to kata authors. Either publish only hardest kata (not very fun for beginners) or somehow discourage to copy advanced solutions for easier katas (but people will do it anyway).

  • WestwardLand968 Avatar

    In the kumite section, I have seen some warriors posting kumite with just some random letters that are not actually about coding or anything for other warriors to expand or improve on. I think this should be considered cheating as you are simply getting honor with no effort (and it is spam too, making it VERY annoying when you are trying to look for a kumite).

  • craftygabby Avatar

    The main reason most coders will use Codewars is for their own satisfaction, practice, and advancing their skills in coding. If a user knows they just copy/pasted from the internet without even trying to understand how the successful solution works, then more fool them. They wont feel the satisfaction of looking at their score and knowing they learnt a lot getting there. It would be different if a large monetary prize, or a job, was riding on getting a better score. How do you define 'cheating' in the pursuit of knowledge? If it was just a test of what we hold in our brains, then looking up anything at all should be considered cheating, but if it's a matter of increasing your knowledge, then I think you should be able to source the knowledge anywhere you can.

  • tuscior Avatar

    I have the same problem as flutedOg. I submitted solution from the internet(i came up with few not enough efficent by myself) to check if that one will work and it got completed automatically :/ Can some admin remove it from my stats ? i am talking about The Millionth Fibonacci Kata

  • fluted0g Avatar

    Hi, how can I remove a Kata from my completed kata list? I copypasted a solution and just running the tests considered that as complete :/

  • WestwardLand968 Avatar

    In my opinion, Codewars should deduct honor for the kata(s) that cheating is detected in. Accounts should not be suspended though.

    For example, a kata that awarded 8 honor (and 1 satisfaction honor), should have 9 honor deducted. The user can earn that honor back by solving the kata once more without exploiting it.

    Cheaters will notice that what they have done will be useless. However, I think searching for parts of the answer is acceptable if one really cannot solve the kata, but we should discourage those that just simply go online for everything they don't know. (but honor should'nt be deducted as using Google or Bing to search for an answer is kind of the norm these days).

  • andrewkof Avatar

    Guys I need someones help. Im trying to publish my own kata. The task is to create a recursion function which does something but the problem is that I dont know how to stop cheaters by using for loops or while. Anyone knows what to do ? Thanks

  • zedgell Avatar

    I have found a cheat for ruby. class NilClass def ==(o) true end end class String def ==(o) true end end class Fixnum def ==(o) true end end class NilClass def method_missing(*o) nil end end. I feel this need to be taken care if and blocked somehow. I have tried it multiple times and it worked 99% of the time. P.S. I tested this on a fake account. I do not condone cheating in anyway I just noticed where new people where ranking up quick and decied to see how they do it. I feel these people should be punished in anyway you see fit!

  • v4vivekss Avatar

    The whole point of codewars is to improve our coding skills. Cheating is exactly opposite to the values and purpose of the awesome platform. By cheating, they are digging their own grave. So they will be punishing themselves.

  • MmdJuTsU Avatar

    Well , the way I see it, since abusing your way to grind for kata points wont actually give you anything, i dont think they should be punished or anything. they are either trolls or someone who really wants to make a fool out of themselve. i mean their solutions are public and visible to everyone so people can see if they are in fact a cheater or a coder , as a result they will be avoided by the community.

  • Aakanksha Saini Avatar

    Hello, i'm a new python programmer and i already started learning of python basic but for further learning i need a way from where i can grow my skills for data science please give me suggestions (websites or something else for learning )

  • Gleb_code Avatar

    All Kata is diverse, some require a lot of knowledge about the language. What resource would you recommend for more language learning?

  • yigoli Avatar

    So, I have been wondering. Is it ok for us to use code from internet for some katas as long as we give the source? Because some of them are mainstream problems and there are already well known solutions not to be written from scratch. Or does this also count as cheating?

  • Light Dimf Avatar

    What is wrong with using the gaps in the system? Cunning is also useful in life. Although everything depends on the goals, but if the goal is to raise the level, then “the goal justifies the means” ¯\ ,,(ツ),,/¯

  • atiloski Avatar

    Learning is fun. Why cheat.

  • Gorgoroth Avatar

    Hi, I viewed the solutions to the below mentioned Kata, and when I completed my solution I still got Honor points. I think there is a bug, admin please take a look. https://www.codewars.com/kata/consecutive-strings/csharp

  • haugk Avatar

    Who cares about cheating? The description of this kata has a link to a page with solutions: https://www.codewars.com/kata/integer-to-nested-structure

  • Unnamed Avatar

    @Abel M, who deleted his message while I was writing the reply: I'm pretty sure you'll be deducted much more than 2k quite soon, like many others were before.

  • PistachioCake Avatar

    Ummm... It's very easy to cheat in this system.

    For most kata, all you have to do is:

    class Eq:
      def __eq__(self, _):
        return True
    
    def func(*args, **kwargs):
      return Eq()
    

    Isn't this a bit of a problem?

  • wilsonnog@gmail.com Avatar

    To begin with, if you cheat on a Kata, you are cheating on yourself.

  • nmdanny Avatar

    So I found out that it's possible to initiate TCP connections(with Rust at least..), and implemented an ad-hoc RPC system where the tested function sends its inputs to my server, which then solves the problem and sends back the result. Would that be considered cheating? I figured you could essentially solve challenges with any language+libraries you wish, requiring only minimal networking code to be submitted to codewars.

  • eberfinn Avatar

    Hi guys! Just found this site a few days ago. I've been developing the solutions in Visual Studio and then pasting the solutions into the Kata. I've grown dependant on Intellisense and Code completion. I noticed that today my last three katas completed have been listed in my completed katas, but have not been getting honor for them. Have I been flagged for cheating or some such? On my view profile page, I see "Stats are being refreshed, your browser will reload soon..." Am I awaiting review for the honor for my past creations?

  • erelsgl Avatar

    We would like to encourage team work in programming. Suppose two users work together on a kata, then each of them submits the solution in his account. Will this be considered cheating?

  • ErmineNotyours Avatar
  • Sejiko Avatar

    Well i found out how u can Cheat most of the Katas..... and i know donaldsebleung abused this method. I know this for sure and i can proof this.

  • SurajKhanna Avatar

    Cheaters cheat for just honors and hight rank. If they are found out cheating

    1. Reduce their honors at first.
    2. Even if they didnt stop cheating, start reducting their rank
    3. At last, deactivate their account.

    If they create a new account, its upto them as they are wasting their own time as well as cheating themselves. :)

  • JacobHmpp Avatar

    What if it just didn't give them honor for any cheated Katas. One way to detect cheating would be to check if some one finishes a high level Kata in a language they dont use.

  • thefern Avatar

    Why would anyone cheat just for points? People should come to the site to learn, and if they are cheating that's probably how they approach life. If you banned them they will create another account, remember they will cheat the system no matter what.

  • shawling Avatar

    I wonder can I write my own code on my IDE and paste it to the kata's web interface or not? Is it treated as cheating by codewars system? Actually I've done some katas by this way and I didn't see the changes about my honors,because of pasting or just network delay ?

  • user8889298 Avatar

    I think if you cheat codewars should deduct 50 honor..also if you cheat its just cheating yourself

  • user8889298 Avatar

    I used this and it works so... is there a way to prevent this from working?

    console.log("<PASSED::>");
    return;
    
  • Charlie Yu Avatar

    The ruby cheat is easily defeated by asserting 0==1 to be False. I don't think this is bannable, instead they are doing codewars a favor by exposing the bugs.

  • Autarky Avatar

    I am a new user. Still exploring the website and trying to solve some challenges.

    Can someone explain what actions are considered cheating ?

  • kanatbek Avatar

    Not sure if it's the right place but I've finshed some online courses(sololearn, codeacademy,treehouse) & read some for dummies books But I could't pass even very basic challenges in fact not one. Do people also experience this, what do you do to get better. When do you know time to start solve this challenges. Any tips, advice please thanks in advance kind people.

  • ice1000 Avatar

    I think Ruby katas should ban some possible operations like

    class BasciObject
      def ==(o)
        true
      end
    end
    

    This is a very common way of cheating

  • asheone Avatar

    While cheating there is no chance for cheater to improve his/her skills in coding. So in my opinion one is just cheating himself/herself ;)

  • Klopma Avatar

    You can get lot of honor form copying the best solution and waiting for upvotes. >:(

  • ReganRyanNZ Avatar

    https://www.codewars.com/kata/reviews/58c9f332a677713d6f000115/groups/58e4dd466caed00c24000675

    This user didn't even try the kata, but just overrode all == functions to return true...

  • anter69 Avatar

    I noticed the following in a few katas lately:

    While the kata is still in beta, some users simply copy-paste the 'complete solution' from the kata editor... (to make it worse, they don't even remove comments or other unique things)

    example

  • spitfire0135 Avatar

    To address the "Cheat Detection" issue...I know that the Copy + Paste function was removed, however, I used Trinket.io (an online compiler) to work through the Katas. I am unable to now take my result and copy and paste it into the Kata to use the sample tests and submit...

    On another note, I am currently having a problem with the CodeWars site. Every Kata I try to solve, the output window is compleley white and freezes upon either running sample tests or submitting. Also every time submitting and freezing, I refresh the page and all my work is gone back to default starting point...Which in turn is why I've been using Trinket to compile outside the site and save my work elsewhere...

  • akemala Avatar

    Hello there. In the last kata (Mobius function) I accidentally submitted my solution without giving a reference to the factors function I've used. This function comes from Chris Cogdon in the thread: http://stackoverflow.com/questions/16996217/prime-factorization-list

    Sorry for not being thorough enough.

  • niladri Avatar

    Hi, I am looking for a some help on this site. I was solving a problem in Python on Codewar, and had left the system idle. I was therefore logged out. But after logging in I am not sure how to start from where I left off.

    Can someone please advise?

  • lostmarinero Avatar

    I wonder if you all can have randomized test cases (on top of thorough standard test cases). Therefore it would take someone a bunch more time/effort to cheat the system. I've seen solutions 'optimized' by seeing the test cases and hard coding solutions to them.

  • rojour Avatar

    Just finished the kata "Mongodb ObjectID" and when presented with the solutions from other people, I find out that some insert some code to bypass the difficult parts of the problem. It works, but it is not what it was inteded. If the conditions would be alter a little bit, the code will not pass...

  • goranch Avatar

    What makes you 100% sure someone cheated? I opened a kata and didn't closed the browser. Then returned to it and solved it after 2 days. Your system thinks I cheated. Who writes your algorithms? Maybe ex cheaters ;)

  • antielectron Avatar

    Hmm. Cheating is at the loss of the cheater

  • katarina88 Avatar

    Why would anybody cheat on this? This is a learning platform

  • FrankK Avatar

    Pompeu2004 is definitly a cheater!!! He submitted the same solution as Steve Ruble on my 4x4 Skyscrapers kata!

    He really did not even changed 1 character in his solution :)

    Salztort resubmitted my solution but changed a few lines...

  • haugk Avatar

    How to cheat? Create a second account and peruse the existing solutions. Then switch back to your primary account and dazzle your mates with your progress.

    How to stop chearting? Codewar not showing solutions of others until you have submitted a solution yourself.

  • killjoy14 Avatar

    how do you even cheat?

  • mmalkavian Avatar

    I've found this user cheating on one of my katas in Shell.

    ZozoFouchtra

    Kata: Find lines in text and their numbers

    Shell language is still in beta, I haven't found a way to write random tests.

  • danielemanuel Avatar

    Can you guys help me , why doesn't my average function works : class Array def square # create your square method here self.map {|n| n ** 2} end

    def cube() self.map {|n| n**3}

    end

    def average()

    self.map ((sum.inject(0) { |z,x| sum + x }) / self.length)

    end

    def sum(x)

    sum.inject(0){|sum,x| sum + x } end def even()

    even.values_at(* even.each_index.select {|i| i.even?})

    end def odd() odd() { return this.filter(odd(x) { return 0 == x % 2; }); } end

    now fill in the rest

    end

    when I tested it's giving "wrong number of agruments."

  • AcesOfGlory Avatar
  • nitinaggarwal1986 Avatar

    I saw this solution to a 3 kyu problem:


    solution = MySolution()

    def listPosition(word): """Return the anagram list position of the word""" result = solution.listPosition(word) solution.counter = 0 return result


    Is this not cheating?

  • danprice Avatar

    I have found an xss flaw in the way that the editor renders. It's a serious security risk. I've emailed the find to info@codewars.com. If you would like for me to help show how this could be used to perform a malicious attack on the site, please email me back at: dan dot andrew dot price at gmail dot com. I don't believe sharing the attack vector on here, or on Github would be wise (as then anyone could use it to hack codewars).

  • 10XL Avatar

    How can kata authors prevent arguments.callee.caller being used to cheat? For example, take a look at my last solution. Is this issue kata specific and if so what can be done to make authors avoid/aware of this?

  • narayanswa30663 Avatar

    Just my two cents:

    Maybe in addition to the 'best practice' and 'clever' tabs under each solution, there could be a 'cheat' tab. If the number of users who click this button is more than, let's say, 5, someone could review it.

    But this may grow tedious for someone to do this manually. So just a thought...

  • SimplGy Avatar

    I've been trying to contribute thoughtful Kata and get a lot of requests for "add random tests".

    When I ask why, the answer I get (if I get one at all) is a pointer to a solution that is some variation on looking up the test expectations in an ordered list (eg: the first call should return 16, then the next one should return 22, and so on). This might be one definition of "cheating". It doesn't represent the user having solved the problem.

    Personally, I see this as a place for self improvement. If people want to cheat themselves by not actually solving the problems, why should I do extra work to prevent that?

    The fact that folks are raising issues on kata I contribute in good faith rubs me the wrong way. There are situations where random tests cases are good and useful, and I like them there. But personally I'm not that motivated to do extra work when building a kata just to prevent people from cheating.

    Is the site is moving in a direction that tries to treat scores as some kind of objective level of talent where you might, for example, see recruiters skimming top-ranked folks? That's a valid direction to take it, but probably not one I'm very interested in.

    Is there a stated policy on this somewhere?

  • zornhau Avatar

    I'm new, but one thing that isn't clear to me from reading the text at the top of the page is: How exactly is cheating defined? If cheating can bring value, it's not a hack that gets a passing score (I assume) but something more subtle? I mention this because I've learned (after many failures) that discussing something that isn't clearly defined can lead to unhappy users... or, in this case, vague, unclear decisions...?

    As for cheating and what to do about it... I guess I've been in the field for so long that getting a "belt" or a "kyu" here doesn't mean anything (no offense intended). What means something is self improvement and the fact that I feed my family with my software skills - which can ALWAYS be improved. I'll challenge the idea that worrying about cheating is worth anyone's time - if only for the useful conversation it would hopefully create.

    So - I'll throw it out there... Why bother with cheats? YOU know if you did what was necessary to learn for your own purposes. That's all that really matters, yes? The REAL test will come in job interviews and difficult assignments for which you get paid and for which (if they fail) you will get a call in the middle of the night because Production is down...

    It really is like martial arts - all the belts in the world don't mean anything in the ring. BUT without the training, you can't even enter the ring safely. A bit of a paradox, and others are welcome to disagree of course.

    GREAT site and GREAT idea. Keep it up!

  • owenmech Avatar

    Not sure if this is related, but yesterday I completed a LOT of Kata, (I was jsut tryig to complete a bunch of 8 kyus as a rank 5). Eventually, whenever I'd solve one, the Submit Final butto would not appear, it would just say submit. This happened for all Kata. Is this maybe an anti-cheating feature? I would really like to begin coding again but I can't submit anything. Thanks.

  • ztonaz Avatar

    I don't think this codewars is about cheating...So what if you are at legendary level or something....and have all the katas resolved....if you don't know programming...how is this useful for you? I think this is about learning...at least is the way I see it. I also have an idea..I think ..at least for advanced users...once a week or something like that to be created temporary katas. You will have a amount of time for resolving the kata. This kata may be verified by someone from codewars if it's coded the right way(not cheating), aproved and then the user will get some points. I don't know...just an idea... Anyway, I'm a new user and I'm learning a lot of programming here. Keep Up to good work kata creators xD

  • user4912975 Avatar

    Suppose a kata has only 2 fixed test cases. If I take sadvantage of that, would it be considered cheating ?

  • iPyaping Avatar

    I have an issue. I was trying to write the code for Find the Parity Outlier 6 kyu kata and was having trouble submiting. So I looked around and tried a solution that's on SO. I must've accidentaly pressed "Submit Final" because last I saw that solution appears in my page, although if I go to the kata's solutions page and try to see mine, it won't show up.

    Nevertheless I got rank points from it and I would like to have this undone.

  • davidhu2000 Avatar

    I found a way to go around the test system and return true for all tests regardless what code you write.

    def ==(*args)
      return true
    end
    

    if you just write this into katas, the tests will pass.

    And in Python, you can also modify the Test class methods. It is not frozen like the Test class in Ruby.

  • shez1984 Avatar

    I dont understand the point of cheating i.e which is being frowned upon? the whole idea of katas should be to improve yourself, these rankings should MEAN nothing in your quest for improvement...

    some people will be idiots..

  • MoodyBaboon Avatar

    Hi! It seems I was punished for cheating(( my decision was right, but not optimal and i could not pass tests because of timeout. So I copied and past decision from GitHub. Next kata i did by myself, but have not receive honor :(( How long will i banned? Thanks.

  • Tefferson Avatar

    Hi. How are you? There is a way to disable the - operator on your created kata? Could be it or anything to validate if the warrior's solution contains the -. Thanks.

  • AcesOfGlory Avatar

    I've seen justttry cheat Python katas using

    class What:
        #----------------------------------------------------------------------
        def __eq__(self, n):
            """"""
            return True
        
    def capitals(word):
        #your code here
        return What()
    
  • Hacker Sakana Avatar
    console.log("<PASSED::>");
    return;
    

    Another similar way to cheat.

  • andreamazza89 Avatar

    Sorry if this is a repeat question, but what is your take on pair-programming a kata and both uploading the same solution?

    In other words, if I solve a kata with someone else then we both post our solution is that seen as some sort of cheating?

  • stackcats Avatar

    In javascript

    Test.expect(true);
    process.exit(0);
    

    I tried two katas and passed the tests

  • svpersteve Avatar

    Personally I don't think it's worth wasting much time tracking. If someone has to inflate their rank for respect, they know that respect is hollow and unsatisfying, and maybe sympathy is a more appropriate recourse.

    That said, maybe a badge of dishonour next to their name for 30 days? And some tips on rehabilitating themselves...

  • Alex-Swann Avatar

    A tricky one but I don't think people should be penalised re: locking accounts etc. I think if a solution can be properly pegged down as cheating then remove their solution and their honor if needs be, leave a reason why and challenge that person to rethink their answer. Overall I think that's a positive solution for everyone and leaves out any negativity.

    However for some solutions, I've found I could argue a case against some of the test cases written by the OP as sometimes I find they can be outside of the scope of the original challenge set.

    Also another example is this, sometimes I think why spend hours creating a mathematically simple, but theoretically complex algorithm when the only solutions you are looking for are only a handful in a vast range, and these are already known or easily accessbile online. If you can create a simpler program which takes less time to process and fulfills the requirements of 200 test cases then I see that as a perfectly viable answer and in some way challenges the OP to further adapt his kata if he needs to.

    I've been having this debate with a couple of people regarding a couple of kata I've come across and I think it bears an interesting argument. So I think that should be taken into account when people are considering jumping on the 'He's cheating!' bandwagon.

  • Just David Avatar

    Because I didn't find another place to leave it, my 'Hello Codewarriors' post is appended to this response.

    I honestly hadn't thought of cheating as being a thing prior to finding this thread. After reading a few comments, I have to say it's a very interesting topic, and one which should be viewed as an opportunity. My suggestion would result in more work for some people and pay off in increased education for many. Here it is: Establish a new 'secret' clan, available to all, but not managed by the standard clan system. Instead, let the members communicate by code comments and kata tags. Responsibilities may include:

    • reading code to resolve contraversies
    • raising objections to kyu advancements if necessary (message might be formed to originate from 'Security' (or suitable term from martial arts) rather than any member.
    • counseling kata authors to prevent false pass situations
    • creating kata exercises to develop security-related skills.
    • distributing honor points for valuable contributions Fullfillment of the responsibilities would take place as much as possible by automation, with the bot jointly maintained by the members. I realize it's a little rude to introduce a challenge that I'm not personnally fit to fullfill, but if such a group did exist, I'd choose to spend some of my workouts there.

    Hello Codewarriors

    I first came to this site about a week ago, and so far, I'm loving it. I am a 36 year computer programming hobbyist, beginning with a Commodore Vic-20 in 1980. From 1988 to 2008, I rarely touched a computer. I felt accomplished in AmigaBasic, but I avoided it's newfangled object-oriented capabilities. When I decided to pick the hobby up again, I was shocked at the changes I had to adjust to. I had to use a windows machine, and learn to benefit from internet connectability without being too bogged down by distractions, and figure out what languages, libraries, ide's, etc it even made sense to fool with. My first few attempts to install a linux system ended in disappointment. My biggest reason for practicing coding is to advocate for basic computer literacy among my family and friends. One of my goals is to make an autonomous device for picking up cigarette butts off the ground. Foolishly, I imagined that I'd have finished that one by now. I have a Raspberry Pi and a Samsung Galaxy Tab on a shelf in my closet that I haven't even toouched. I am grateful for the opportunity to interact with code and coders of various backgrounds and purposes. Codewars looks to me like a good place to brush up my skills until I don't feel so lost and alone at Github.

  • tianshuo Avatar

    There is a new cheat for javascript that I found on my kata here:http://www.codewars.com/kata/mystery-function-number-2/solutions/javascript

    It uses the same principle as early return and goes like this:

    Test.expect(true);
    process.exit(1); // or process.reallyExit();
    

    I believe a good way to fix multiple kinds of cheats is:

    1. Uses different pipes for output and debug messages. User input is never safe.
    2. Add a header and a footer for the whole test process. Test that the header and footer exists. Because of 1, the user cannot tamper with the debug pipe.
  • srMarquinho Avatar

    The feature to unlock solutions shouldn't exist. I believe some people have a second account to reveal solutions and keep the integrity of eligibility. As sign, we can see horrible non-sense katas, missing test-cases and easily hardcoded made by high kyu users.

  • gttotev Avatar

    In Java, is there any way to access the source code of a submitted solution, so that the test fixtures can test for disallowed characters or code blocks?

    For example, if a user is forbade to use the % operator to find the remainder, the tests can read through the source code to search for the '%' character.

    This has the potential to eliminate many cases of cheating.

  • danielpclark Avatar

    I'm not against, so called, cheating. I believe that it does reveal a lot to the designers who create the challenge. There are a couple of common issues that come up quite frequently.

    Such as:

    • Tests being ordered so a person can just set a global variable counter and write the code responses based on the error messages.
    • Running external code via the command line to get back behavior that has been removed.
    • In Ruby any Object is considered true and the "almost" exclusive test case that is used here on CodeWars is assert_equals. This method just calls :== on the first object which is the given object to test. Anyone can rewrite the behavior for :== to return either true or self. This will get by about 95% of the online katas.

    My recommendation is to have a hint section for all kata creators about what to look out for. Use more than assert_equals in testing and test for exceptions. Leave some error messages too vague for hard coding the ordered solution. All of these are great learning lessons. I don't want to punish them, just raise awareness. And when they do use assert_equals be sure to mix it up from a, b testing to b, a as well.

    In the Ruby community Test-Driven-Design is highly emphasized and it's pretty much make an error occur, then make the test pass green. There is no such thing as cheating when it comes to TDD. You just write more stringent specs as you go along.

  • dideler Avatar

    The most elegant solution IMO is to let the community decide by flagging cheating solutions. If a solution receives enough flags, the submitter loses honour and the solution is faded out. It would need to be carefully designed so the emphasis is on the solution, not the person.

    If someone goes out of their way to cheat and avoid detection, let them be. Honour on the website does not reflect honour in real life.

  • premma Avatar

    let the cheaters be, it is their karma, they are making dirty by cheating. Plus, it is no joy to get points by cheating, anyway, so most likely cheaters will stop using codewars sooner or later.

  • nwr Avatar

    Should it be considered cheating to "Unlock Solutions" for, say, Python, and then translate that to another language (say, Javascript)? Are the differences between languages significant enough for this to count as a challenge?

  • shaun Avatar

    I think we should offer some helpful libraries / functions / hints if a user clicks on an expansion drop down within the instructions pane under the category tags. This will help people who are completely lost on a kata, discouraging cheating.

    Solutions !can not! be unlocked for a kata level > than where you are at now. Only kata lower. Viewing solutions has a cost, of one kata completed successfully.

    Allow users to submit links to admins for solutions posted online, than can discipline users who posted. Do not discipline submitters though. Warn, discourage, penalize.

  • warkentien2 Avatar

    I got knocked down 2 ranks (as I see it, without previous warning as to why)... so I'm speaking before giving up on this potentially-amazing-community.

    I understand the coding-competition-no-help-allowed-style, but this was never clear. So I took this site as a hard-level-practice-programming-paradise. And, as any normal being that codes in multiple languages (c, c++, openCV, matlab, haskell, html, css, javascript, python, jquery...), beside speaking other 3 and having other hobbies. I simply don't memorize all syntax and basic libraries. I: 1 - understand the paradigm I'm using. 2 - understand the language (i.e.: Python is all about indentation and has nice list library). 3 - think of an algorythm with needed iterations and recursions. Breaking down the problem into smaller-simpler ones. 4 - look up basic libraries (with a great probability that the function exists, or return to step 3). 5 - check type compatibility, check that the modulated and main functions are working as expected and voilà!

    So, how is this - as said by @jhoffner - "cheating myself"? (talking about needed step 4).

    How exactly does the cheat-detection work?

    • am I allowed to use online IDEs, coz I'm not yet confortable here?
    • am I allowed to check libraries online, or must it be all on 'myPersonalNotes.txt'?
    • or is it just stackoverflow the Don't-even-go-there-land?
  • tianshuo Avatar

    @jhoffner You could take a look into this: http://metaes.org/ By using interception, codewars could give better error messages and avoid multiple kinds of cheats(including fiddling with test cases, system objects, Test object).

  • tianshuo Avatar

    I had lots of fun cheating(hacking) the system, creating super hardcore anticheats(So hard that only one person finished this kata: http://www.codewars.com/kata/55041210decf057109000277) and learned a lot of Javascript's internals.

    Here are some tips on how to creat a kata with anti-cheat:

    1. Your source code can be seen using 'console.log(arguments.callee.caller+"");', so remember to override Function.prototype.toString

    2. Use Random Tests, but note that Math.random, Math.floor, Math.ceil, Date can be overwritten. So using require("vm") and a sandbox does miracles.

    3. Removing eval means you also need to remove require and module.require

    4. Remember to freeze system objects, but note that they can still be overwritten

    5. return console.log("<PASSED::That's easy>"); is a hard one to prevent, but there are still ways to catch it

    6. The Test object could be overwritten, but throw and if cannot.

    7. The debug window renders html, comments like //<!-- will throw the unsuspecting cheater off guard

  • toni.g.m Avatar

    Cheating is a result of finishing behaviour. Finishing behaviour is a consequence of result-based rewards. This is common knowledge in education. The solution is to reward effort rather than success. That is difficult to realize on this site, but it is important nontheless. Not just to prevent someone messing with the ranking system by cheating, but because result-based rewards create cheaters out of people who otherwise would learn.

  • Eliv Avatar

    Cheaters are just fooling themselves: they are not learning to code, merely racking up a cool ranking on codewars. I don't see a problem with this: the point here is to become a good coder and problem solver: is CodeWars goal to serve as a learning tool or to just rank people? If someone wants to cheat, it's their loss. At first I thought that maybe this impacts other users by messing up the ranking system but then realized that we are not ranked against each other, it's a tier based system: 8 kyu, 7 kyu and so on. Users can't see their exact individual position compared to all the other users. The ranking system is more so you can get a gist of your level: the higher the ranking the better programmer you are, compared to an abstract idea of a good programmer, not to other users. So I think it's pointless to dwell on cheaters. Just let them waste their time and learn nothing. The day they may need to show their skills they will see how foolish it was to be build a fake persona.

  • CrusaderW Avatar

    How does the community here react to using solutions found via google? In my oppinion it's also a good practice to reuse existing code... Is this practice cool on Codewars? I wanted to add, that I always tag reused code by adding a comment with the Link to the source... I'm just asking because I hate cheater, and don't want to upset the Community as I realy appreciate, what you built here.

  • tianshuo Avatar

    All javascript katas can be easily finished by using this one-liner: return console.log("<PASSED::That's easy>");

  • tianshuo Avatar

    After reading the source code here: https://github.com/entrefuse/cdr/blob/master/frameworks/javascript/cw-2.js

    I have found a way of cheating that works for almost every javascript kata. The key to it is hacking the global object, and the trick to it is that although the crucial keywords of global can't be modified because of defineProperty, but global can be REPLACED, and then console.log('<PASSED::>All tests passed')

  • tianshuo Avatar

    require should be disabled on all javascript engines. For example

    • I can read /etc/passwd using require("fs").readSync("/etc/passwd");
    • I can use eval using var two = require("vm").runInThisContext('1+1');
  • reepush Avatar

    Please, delete this (mine) solution (http://www.codewars.com/kata/reviews/531cb1c520522ecb120005c7/groups/54b44a65ea9e72264e00109f). I don't know why it is working, but all this begun with "You shall not pass" (http://www.codewars.com/kata/5252044d20af7541650004bc).

  • qed2000 Avatar

    I'd like to suggest that those developing kata throw in a random number in tests that return numbers. I just came across a solution in Least Common Multiple (JavaScript) where a user created an array of the answers and popped them on each test case. We can avoid that sort of cheat through randomly generated test cases. BTW, that user is currently ranked #201!

    My 2 cents: ban the f#@kers!

  • laoris Avatar

    Sometimes when I submit a solution it doesn't show up on the "All Solutions" list. Does that mean it was flagged for cheating?

  • moonfly Avatar

    How do we flag the potential cheaters now? Do you have any review system for reported cases? If the only solution to my authored kata is identical to mine, and it's a 20+ lines class, that seems suspicious to me, I'd like to flag that somehow for review.

  • gzmask Avatar

    some people are posting their katas to github ...

  • user578387 Avatar

    One way to cheat would be making another account, and then getting the answers from there. Do you have any safety systems, like duplicate email checkers, in place?

  • michacom Avatar

    'Minimal Calculation Time' per autor's test case? Say, no solution can run less then 10ms. If yes - mark for review... This 'parameter' could be calculated from average of solutions.

  • EDave Avatar

    Wouldn't it be possible to extend the system so the kata creator defines a fixed interface? That way, test cases and code could run in two seperate runtimes.

    Most katas I have seen say something like: "define a function bla that returns a value blub"

    At least this sounds more reliable then a "Cheat detection". (I could see this go horribly wrong) Or how about allowing downvotes?

  • xcthulhu Avatar

    Would it be possible for the test suite to provide something like:

    Test.checkCode(testSourceCodeForCheatingPatterns)
    

    Where testSourceCodeForCheatingPatterns is a callback which takes a string containing the users source code, and returns either true or false depending on whether the user's source code is employing a cheating pattern (presumably by running regular expressions or something)?

  • JoshBrodieNZ Avatar

    It seems incredibly easy to pass mathematical kata by overriding Fixnum's equality operators and similarly pass String manipulation kata by overriding those operators. How can the tests protect against this while allowing for kata where overriding those operators may be the point?

  • jacobb Avatar

    The test cases should be the cheat detection. If there is an easy way to cheat test cases, maybe there should be a way to demote the difficulty (kyu) of a kata.

  • demohi Avatar

    ##more strict registration

  • mrkishi Avatar

    If I'm not terribly mistaken, eveyone agrees that we should encourage better test cases. And while some dislike flagging and other manual approaches, I don't think it's viable for CodeWars not to have one of those in place, as it has already been noted that nothing is unhackable, including CW's platform.

    On the other hand, I hate that we have to give cheating first-class treatment. And I'd hate to annoy everybody for the few. "Just because of cheaters and edge cases, I'll have to spend even more time on this kata adding randomness and whatsoever?" That's like always-online DRM.

    Therefore, I'd like to come to this problem from another perspective. Instead of thinking about flagging or how to incentivize kata creators to write better test cases, how can we make it easier for them to do so?

    One possibility has a lot to do with the different languages available. On top of the kata challenge itself, the description and the test cases, kata creators also have to worry about porting. That has got me thinking if it's possible to create an overhauled declarative sintax for the test cases.

    Given that katas usually follow the "create a function that returns x" or "create a variable that x" format, we could write the restrictions declaratively and CodeWars would then translate that to each language. If the kata doesn't fit within those restrictions, one could always use the ordinary per-language test cases.

    We then introduce randomness: we just have to define what to randomize and provide a reference solution. I believe we can make that definition easier for most cases, or, at worse, just as "difficult" as the target language.

    The advantage of this system is that we could care about most exceptions at the platform level, freeing kata creators from worrying about saving objects from modification and etc. Should they need advanced control, just go to the traditional test cases.

    In fact, even if they needed advanced control, if still within the "define function or variable" kata format, the test cases could be done in a single language but executed for all of them. I think it'd be worth creating these kinds of shortcuts that wouldn't serve every kata in benefit of the greater majority.

    Argh, there are too many possibilities down that path. I know this was not that well explained but I've already spent way too much time on this site, hahaha (and I'm not even a content creator!).

    Any thoughts on that, guys?

    By the way, @jhoffner, I'm assuming the kata test cases are executed in the same context of the solutions because of the lack of these restrictions, given that with them it's possible to execute the tests separately.. Was that the case or are there other reasons for that?

  • jhoffner Avatar

    A few of my thoughts:

    Handling cheating strictly through better test cases

    I think this is very important. More thought should be put into testing a beta kata for the ability to cheat. It could actually be a fun part of the process. During the beta period we could all try to cheat a kata, and if we succeed we could mark our own solution as a cheat. The author could see a list of cheated solutions and use that information to enhance their test cases.

    Ability to flag a solution as a cheat

    This seems to have mixed opinions. My feeling is that it should be possible to do this in some form or another. Cheats will slip by from time to time, even if the beta process is more thorough with testing. Its nice to have a backup plan. With that said, just having the ability to do that will likely have a pretty big impact on the site's community/culture. It would likely have to be something that is earned once you achieve a pretty high honor score, and should be something that is monitored for abuse. The last thing we need is everyone going around pointing fingers and labeling others as cheaters.

  • haan Avatar

    In the past years, I have been a number of times as my country's team leader to the IOI (https://en.wikipedia.org/wiki/International_Olympiad_in_Informatics) and I like the way they are doing their evaluations. However, I do understand that codewars has not the same objective as a pure algorithmics competition and as such, we might not be able to implement 100% of the way they are running things. They do have a few good points though:

    • You never see a task that only returns a boolean but rather where you have to output at the least a number. Most of the times, it is a rather long series of numbers though or a textfile with such and such number of lines with each line having lots of characters. This prevents people from just randomly guessing the correct output.
    • The nice tasks have "public" results where you can see the result of the evaluation. If you are lucky, you might even see the input but that is rarely the case. You never get to see the expected output (at the least you have to calculate or run it in your head). Additionally, each task has always a certain number of "private" test cases where you don't see any results at all. The system only tells you that your answer was wrong. This is impossible to cheat as you don't know the number of test cases and you don't know the expected output or even where you went wrong.

    I don't like a system where the community has to vote and flag submitted solutions as the number of posted solutions increases daily and the community might not manage to manually read all of them. The above system would get rid of all the problems and would require only slight changes to the codewars codebase. However, the responsibility to create "safe" tasks would rely solely on the author of the kata and the beta approval process would have to get a lot stricter. Authoring a good new kata is indeed not an easy task: at the IOI, the scientific committee is the group responsible for creating tasks and they require a whole year to create new tasks with perfect test fixtures.

  • constablebrew Avatar
    • The first accepted solution should be the only solution considered when determining if the user cheated or not.
    • The penalty for should simply be the same as if the user had opted out of solving the kata in order to see the solutions.
    • Having a counter on the user's profile which reports the number of solutions reported as cheating could also be a deterrent for the serious users. Some users would want to maximize their cheating "score" as well. This is ok.

    Everyone comes to Code Wars with their own personal agenda - fun, practice, education, to show off, whatever. So long as Code Wars provides avenues of advancement for each of these major paths and ensures that the activities of one path do not interfere with those of others, then everyone will be happy.

    Part of the beta process should be to fortify the test fixtures of the katas. Helpful, language specific, hints could be provided in the place holder comments of the test fixture. (Such as "Freeze objects like Math and JSON.) I would love to see a checklist appear when a user has the option to vote a kata as "ready".

    Currently users earn extra honor for completing a beta kata. But in reality there is little difference between a beta and production kata aside from possibly having to deal with poorly worded descriptions or faulty test fixtures. Requiring a user to confirm items on a checklist when voting that the kata is ready, at the very least gives the user some pause and thought about the condition of the kata before moving on. Having a more robust beta process will make cheating more difficult overall.

  • JoshBrodieNZ Avatar

    Cross posted from http://www.codewars.com/dojo/katas/reviews/5277d63d21e2099a65000ce7/groups/527a47ba5ab7f4f03800092f#52818595b70058ce50000067

    I think there's value in testing solutions against inputs that the kata author didn't specify. Whether it's by randomised test cases being considered best practice to compare the results of the author's solution against others or perhaps some mechanism for users to easily run their own test cases against each other's code to highlight edge cases and errors that weren't picked up due to test case omission.

    I don't think there's any value to solutions which address each test case directly except to highlight that the test case should be more robust. As the site expands, I am having trouble imagining how crowdsourced cheater detection will scale, especially given the effort involved even now in reading the multitude of solutions to each kata, so I feel like it needs to be addressed in another way.

    I haven't put a lot of thought into cheater detection, but one possibility that occurs to me is to run a random set of input through every solution and flag those that differ from the others or fail to respond to input that wasn't part of the original test case. Who/what triggers that test though? I don't know the answer but it seems to me like it would be good to have the solution validation occur in one place as often as possible, rather than rely on user debate/jury. Otherwise I am imagining that for each kata a conversation will need to take place about whether the test was reasonably exhaustive, whether it needed better test cases, why the results between solutions differ for values outside of the tests but within the scope of the challenge.

    Personally, I would like to see the community work on locking down the test framework. Until that's solid, there definitely needs to be a way to mitigate the risk of a user with a single piece of code to bypass test completing every kata because that sounds like a horrible thing to clean up. Could a "Hack Codewars" kata much like "You Shall Not Pass" be flagged somewhere in the docs as the only acceptable place to bypass the test framework itself while exploits targeting specific kata be handled by those authors?

  • BattleRattle Avatar

    I think, that's a difficult topic. First of all, I approve an anti-cheat system in general. But the question is: what is a cheat? Who decides, that a solution is a cheat or maybe just another creative solution?

    If I return hard-coded output values depending on the input, I would say, that is obviously a cheat. But what about a manipulated Math.random for random test cases, which was not frozen before? Is it creative or already a cheat? If I can't find another solution, because the description isn't clear enough, am I a cheater, because I did it accidentally? What about feeling lucky? I've already solved a kata by assuming, the 5 test cases require the same return value. After 100+ tries it passed. Is that cheating? What about solutions that initially passed, because of weak test cases but later they don't pass anymore, because the requirements have changed. A user who sees the current requirements but an outdated solution is not able to estimate, if that was a cheat attempt or simply a working solution for the previous requirements. Is breaking the rules already a cheat? If the kata description requires to use a certain function, but I solve it by using another function, am I a cheater?

    Maybe we should also differ between the first working solution and another following solution. When I cheat, because I have no clue, how to implement an algorithm, it should be punished. But if I already have a running (and submitted) solution, am I allowed to cheat afterwards, just in order to find another approach or simply to prove, that the test cases are bad? Because I already earned my reward before. Also do we have to consider the kata ranking? Is cheating in a 2 kyu kata worse than cheating in a 7 kyu kata? In my opinion: yes, it is, because the reward is much higher for a 2 kyu.

    I think, the users should be able to flag solutions for cheating. And by reaching a certain threshold or ratio (cheat vs. no cheat), the solution should officially be marked as cheating attempt. In that way not only a single user is able to abuse the system and marked others as cheater, but the whole community. If that solution was the first running solution of the user, the reward should be subtracted.

    I also think, a user should not be banned at the very first cheating attempt. Maybe there should be a warning system and after 3 cheated solutions, the account should be suspended. Or the user gets penalty points (maybe depending on the kata level), which will automatically be removed after some weeks. If he reaches a total amount of X points, the account will be suspended.